Re: MovieAudioExtractionFillBuffer
Re: MovieAudioExtractionFillBuffer
- Subject: Re: MovieAudioExtractionFillBuffer
- From: Brad Ford <email@hidden>
- Date: Wed, 7 Jan 2009 09:22:42 -0800
<SNIP>
...
</code>
The "outputASBD" is retreived by:
<code>
osStatus = MovieAudioExtractionGetProperty(sessID,
kQTPropertyClass_MovieAudioExtraction_Audio,
kQTMovieAudioExtractionAudioPropertyID_AudioStreamBasicDescription,
sizeof(*outputASBD),
outputASBD,
nil);
</code>
Which is then massaged a little to provide us with the format we
need in the component that consumes the audio track:
<code>
outputASBD->mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
outputASBD->mBitsPerChannel = sizeof(Float32) * 8;
outputASBD->mBytesPerFrame = sizeof(Float32) * numChannels;
</code>
More specifically, the error I am seeing (console.log output from
Quicktime) is:
Failed to create extraction AudioConverter err= ffffffce
InitializeAudioExtraction err -50 creating AudioConverter
Maybe that can provide more of a hint to where the problem might lie.
-50 is paramErr when calling AudioConverterNew, which means one of the
asbd's is wrong. I'm betting it's yours. ;-)
kAudioFormatFlagsNativeFloatPacked doesn't include the non-interleaved
flag, so you're asking for interleaved Float32. It looks like you're
filling out mBitsPerChannel and mBytesPerFrame correctly, but you're
neglecting to set mBytesPerPacket to the new mBytesPerFrame value. My
guess is that CoreAudio's parameter checking for PCM got stricter in
10.5.6. If that's the case, then the bug has always been there in
your code, but you were getting away with it up to now.
-Brad Ford
QuickTime Engineering
_______________________________________________
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