Re: paramErr from AudioConverterFillComplexBuffer with MP3 source
Re: paramErr from AudioConverterFillComplexBuffer with MP3 source
- Subject: Re: paramErr from AudioConverterFillComplexBuffer with MP3 source
- From: Stevo Brock <email@hidden>
- Date: Wed, 12 Apr 2006 16:41:30 -0700
Comments below...
On Apr 12, 2006, at 10:40 AM, James McCartney wrote:
Here are some things that can cause a paramErr from the decoder:
Your input format has a non-zero mBytesPerPacket and in your input
proc you are passing in a buffer list where mDataByteSize !=
ioNumberFrames * mBytesPerPacket. It is safer to assume that MP3
is not CBR and pass zero for mBytesPerPacket.
I have verified that when returning the last set of packets (6), I am
returning 5016 bytes (6 * 836). I tried passing 0 for
mBytesPerPacket and I still get the paramErr near the end.
Your buffer list mNumberBuffers does not equal 1 for interleaved or
compressed formats.
mNumberBuffers is 1 for all buffers. Everything is interleaved or
compressed in this case.
The codec is returning a paramErr. You could be passing in bad data
or bad packet boundaries.
Not very relevant to figuring out what's going on here, but paramErr
doesn't seem to be the right return value for this case. Doesn't
paramErr mean there's something wrong with the parameters I'm passing
to the function?
The first thing I would do is not assume that you have CBR MP3 and
make sure the packets you are passing in are starting where you
think they are.
We're getting this info from QT. For this particular file, QT is
saying it's CBR and giving the packet info below. Even if I change
the system to read 1 packet at a time, I still get a paramErr on the
last packet.
Why don't you use ExtAudioFile which will read an MP3 file and
decode it to PCM for you?
Well, first off, we already had something in place that works great
long before it came around. Besides, it's 10.4 only and we support
10.2.x onward. I've also heard it's buggy for MP3. Perhaps in the
future, but there's not much point in rewriting the already working
code to use something that's unknown.
On Apr 11, 2006, at 6:20 PM, Stevo Brock wrote:
Hello,
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
Everything seems to be working properly. Each iteration I'm
asking for 1024 packets from AudioConverterFillComplexBuffer() and
getting 1024 packets back, with return code of noErr.
Periodically my MP3 reader is called and returns packets (in this
case, 10 packets of 836 bytes each). At the end, the MP3 reader
returns 6 packets, then finally 0 packets. Then after about 20
more calls, ACFCB() returns only 512 packets and paramErr.
Ignoring this and continuing, the next call returns 0 packets.
Most files have a similar flow, but don't generate a paramErr.
I'm seeing this on 10.3.9/QT 6.5.2 and 10.4.6/QT 7.0.4
How can I discover what is causing the paramErr?
-Stevo Brock
Monkey Tools
www.monkey-tools.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden