The description of the mp3 isn't valid. There should be 384 samples per packet for layer 1 audio. There should be 1152 samples per packet for layer 2, and layer 3 (mp3) audio. mBytesPerFrame shouldn't even be filled out. Here is a valid mp3 ASBD. All skipped fields are set to zero.
desc.mSampleRate = 44100.00; desc.mFormatID = kAudioFormatMPEGLayer3; desc.mFramesPerPacket = 1152; desc.mChannelsPerFrame = 2;
If you are using the AudioFile API for reading the mp3 data, stop. The CA team has even said that its buggy. You'll have to write your own mp3 parsing code. I did this so I can parse mp3 data that is in memory. Note that the sample rate can (and does) change from packet to packet in mp3.
Dominic Feira / Code Monkey / Ambrosia Software, Inc.
On Apr 12, 2006, at 3:05 PM, Stevo Brock wrote: I have processed a TON of MP3 files through AudioConverterFillComplexBuffer with no issues. However, I have just discovered 3 files that are causing a paramErr right at the very end of processing the audio.
The input format is MP3 (CBR), 16, 44.1kHz, stereo, 2304 samples per packet, 418 bytes per packet, 836 bytes per frame The output format is PCM (Floating point), 32, 44.1Khz, stereo, 1 sample per packet, 8 bytes per packet, 8 bytes per frame
|