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: Audio extraction miss understand



Title: Re: Audio extraction miss understand
Siegfried:
   In order to configure an Audio Extraction Session to extract discrete channels from the movie without mixing, you must set the AllChannelsDiscrete property on the session.  What you have done below is to establish a destination channel layout that contains no active channels, which, if it worked, would have resulted in silence.  You also hadn't set the extraction ASBD to match your channel layout, which is probably why it failed.

   Anyway, you will have more luck if you do this:

        Boolean allDiscrete = true;
        Error = MovieAudioExtractionSetProperty(m_ExtractionSession,
        kQTPropertyClass_MovieAudioExtraction_Movie,
        kQTMovieAudioExtractionMoviePropertyID_AllChannelsDiscrete,
        sizeof (Boolean), &allDiscrete);

You should then *Get* the kQTMovieAudioExtractionAudioPropertyID_AudioStreamBasicDescription property in order to determine how many channels this discrete extraction will return, so you can allocate your pull buffers appropriately.

Daniel Steinberg
QuickTime Engineering


At 6:49 PM +0200 9/28/06, Siegfried Hand wrote:
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
  boundary="----_=_NextPart_001_01C6E31E.15C28936"
Hello, i think i have missed something in the audio extraction api.
 
I need to extract each audio track in each audio stream of a movie, to place them in a time line for editing
For ex  a movie with two audio stream in it, one with a stereo track, and an other with a stereo track too.
So for my application i need to extract 4 mono tracks.
 
The audio extraction failed (-50) with this configuration (i have changed the asbd, layout properties & set the mixing as discreet)
But if i edit the movie in quicktime 7 (i leave the first stream as it was (left and right), i set the left channel of the second stream as center-left and the right channel of the second stream at center-right)
The result is L CL CR R and there everything is fine
 
So i think i missed something about discreet channel mixing & the channel layout.
 
Here is tha way i set the channel layout :
 
UInt32 size = fieldOffset(AudioChannelLayout, mChannelDescriptions[m_Asbd.mChannelsPerFrame]);
AudioChannelLayout* playout = (QT::AudioChannelLayout*) calloc(1, size);
 
// expand the layout into a full layout using channel descriptions:
size = sizeof(AudioChannelLayout);
playout->mChannelLayoutTag = kAudioChannelLayoutTag_UseChannelDescriptions;
playout->mNumberChannelDescriptions = m_Asbd.mChannelsPerFrame;
 
for (int i = 0; i < m_Asbd.mChannelsPerFrame; i++)
{
            playout->mChannelDescriptions[i].mChannelLabel = kAudioChannelLabel_Unused;
}
 
Error = MovieAudioExtractionSetProperty(m_ExtractionSession, kQTPropertyClass_MovieAudioExtraction_Audio, kQTMovieAudioExtractionAudioPropertyID_AudioChannelLayout, size, &playout);
 
If somone can help me to clarify this pointŠ.
Thanks.
 _______________________________________________
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: 
 >Audio extraction miss understand (From: "Siegfried Hand" <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.