Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using the audio extraction API



And it then returns an improper call order error. Huh?

Search the archives for a response from me about the conditions in which MovieAudioExtractionFillBuffer returns badCallOrder. The most common is that the movie is inactive. In your case, the problem is probably the mismatch between the AudioStreamBasicDescription's mChannelsPerFrame, and the AudioChannelLayout you set. The ACL you set only specifies 1 channel of audio, but the asbd is specifying the number of channels in the summary mix of the movie. Regardless, this is not how you want to do it.

I did and saw your response. Didn't think it applied to me :) I guess it does.



Instead:

MovieAudioExtractionBegin(...)

Now set the property:
MovieAudioExtractionSetProperty(... kQTPropertyClass_MovieAudioExtraction_Movie, kQTMovieAudioExtractionMoviePropertyID_AllChannelsDiscrete, ... )


By default, MAE gives you non-interleaved audio, meaning a separate buffer for each channel of output. By specifying "all channels discrete", MAE will do no mixing. You just need to know the index of the channel in the source movie that you care about.

Ok, so this means for a track with 2 channels, I get 2 items per sample (Float32 in my case).
But, since I only want one of those (and with a track with 10 odd channels even) how do I further refine it to pick only the one I want?

// finally, extract some data: MovieAudioExtractionFillBuffer()

In the extracted AudioBufferList, just use the one channel you care about.

Ok, cool, so the data is interleaved in here if there was more than one channel present, so I get ONE buffer only, but interleaved, and thus I need to know how many are interleaved, or as above, somehow configure it to return just one.

The code snippet you provided would only work if you first iterated through all the tracks in the source movie and relabelled all the duplicate labelled channels to "unused".

Right, and since the one track contains 2 channels (left and right) I would need to turn ONE of them off.




_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden
References: 
 >Using the audio extraction API (From: Steve Israelson <email@hidden>)
 >Re: Using the audio extraction API (From: Brad Ford <email@hidden>)
 >Re: Using the audio extraction API (From: Steve Israelson <email@hidden>)
 >Re: Using the audio extraction API (From: Brad Ford <email@hidden>)
 >Re: Using the audio extraction API (From: Steve Israelson <email@hidden>)
 >Re: Using the audio extraction API (From: Brad Ford <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.