Processing Mp3



When I’m creating an AudioFormatReader to an MP3 file the manager returns a reader with format name “Windows Media” and not “MP3”, is that ok (tried many files)?

Then for cropping purposes I read it into an AudioSampleBuffer and then I’m writing it to a memory stream with WavAudioFormat::createWriterFor
but it returns null because the bitsPerSample is 0 (reader->bitsPerSample from the original reader)

Am I doing something wrong? (am I doing something right?)

Thank you


You can use the MP3AudioFormat class directly if you want it to have a go at opening the file before the Windows Media codec. Strange that the WM one fails to read it though, I’m pretty sure it works on my machine.