Skip to content

Converting .wav files to .aiff

Keith Boynton

Asked Nov 11, 2012, 10:42 AM EST2 answers
Share
LinkedInX
I'm trying to write a class that will convert .wav files to .aiff files as part of a project.
I've come across this library Alvas.Audio (http://alvas.net/alvas.audio,overview.aspx)

and am wondering if anyone has any experience with it as I'm really struggling to work out how to write the file in aiff format.
I have the following code so far but I can't work out how to define the outfile as a aiff:

string inFile = textBox1.Text;
WaveReader mr = new WaveReader(File.OpenRead(inFile));
IntPtr mrFormat = mr.ReadFormat();
IntPtr wwFormat = AudioCompressionManager.GetCompatibleFormat(mrFormat, AudioCompressionManager.PcmFormatTag);
string outFile = inFile + ".aif";
WaveWriter ww = new WaveWriter(File.Create(outFile), AudioCompressionManager.FormatBytes(wwFormat));
AudioCompressionManager.Convert(mr, ww, false);
mr.Close();
ww.Close();


Any help would be greatfully accepted :)

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • float pave
    0
    I know you can do it with a program called Video Converter here, It is a shareware program, but I think you get a trial period. it will do nearly anything you need, including wav >> aiff.
    Hope it works.


    Regards
    Pave.
    0
  • 0
    Thanks for tip but I was looking to do it programatically. I have achieved it using the following library: libSndFile.NET.dll
    0