static void Main(string[] args) { string mp3File = @"Theme - Simpsons.mp3"; string wavFile = @"Theme - Simpsons.wav"; using (var wr = new Mp3Reader(File.OpenRead(mp3File))) { IntPtr mp3Format = wr.ReadFormat(); byte[] mp3Data = wr.ReadData(); var wavFormat = AudioCompressionManager.GetWaveFormat(mp3Format); Decode2Pcm(ref mp3Format, ref mp3Data, ref wavFormat); MemoryStream ms = new MemoryStream(); using (var output = File.OpenWrite(wavFile)) using (WaveWriter ww = new WaveWriter(output, AudioCompressionManager.FormatBytes(AudioCompressionManager.GetFormatList(wavFormat)[0].FormatHandle))) { ww.WriteData(mp3Data); } } } private static void Decode2Pcm(ref IntPtr format, ref byte[] data, ref WaveFormat wf) { IntPtr newFormat = AudioCompressionManager.GetCompatibleFormat(format, AudioCompressionManager.PcmFormatTag); byte[] buffer = AudioCompressionManager.Convert(format, newFormat, data, false); wf = AudioCompressionManager.GetWaveFormat(newFormat); format = newFormat; data = buffer; }
5 comments:
Thanks for the post..
Here is online free mp3 to wav converter
convert mp3 to wav
Can you please send the sample project with code for conversion from mp3 to wav at my email id tiwariarun4246@gmail.com.
Thank You
Hi smarties) Can you tell me How I can convert this filetype wikiext.com/bnk ?
Share free cutting tools and music converter Mp3 Cutter Online
The blog post is really great. The details of the converter have been discussed. As a result, I was able to easily gain detailed knowledge about the converter. I can easily convert mp3 to wav file and another file.
Post a Comment