Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting mp3 data to wav data C#

Tags:

People also ask

How do I convert an MP3 to a WAV file?

Drag or upload MP3 files to the encoding queue. Select WAV from the Format and Presets drop-down list of the file in the queue. Choose the desired file or files in the queue panel and select Edit › Export Settings to adjust any settings. Start the queue to encode the MP3 and export your new WAV file.

What happens if you convert MP3 to WAV?

If you convert a lossy MP3 back to a lossless WAV file, you won't get any of the data back. Instead, you will get a FLAC file much larger in size, but the quality will be of the MP3 file you converted from. Remember, you will never get the lost data back.


In my project I am receiving mp3 data in a byte array. I want to convert that data to wav format and store it in another byte array. I searched internet for mp3 to wav converters but all of them support file to file conversion. None of them seems to take raw data as inputs. Is there any way I can achieve this in C# ?
Here is the protoype of the function I am trying to create.

   bool ConvertToWav(byte[] buffer){
      //Do some processing and store the wav data in buffer2
      Buffer.BlockCopy(buffer2,0,buffer,0,buffer.Length-1);
   }