This project has moved. For the latest updates, please go here.

Convert wav to wma

Aug 11, 2014 at 1:15 PM
Edited Aug 11, 2014 at 1:18 PM
Hello. I'm trying to create a many simple WAV to WMA converter but I can't set a value for profile in WmaWriter !!

help me !
WaveFileReader wr = new WaveFileReader(@"C:\mywav.wav");
WmaWriter ww = new WmaWriter(new FileStream(@"C:\mywma.wma",FileMode.Create),new WaveFormat(44100,2),profile);
 
byte[] buff = null;

int read = 0;

buff=new byte[wr.Length];
read = wr.Read(buff,0,buff.Length);
while ((read > 0))
{
ww.Write(buff,0,read);
read = wr.Read(buff,0,buff.Length);
}
Coordinator
Aug 20, 2014 at 1:56 PM
you may find MediaFoundationEncoder easier to use