Mailing Lists: Apple Mailing Lists

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

Audio extraction and LPCM data value questions



I am new to audio extraction and I have 2 questions about it.

1- After the audio extraction (using default settings), the float32 AudioBuffer data contains negative values as well as positive values (0 mean silence). Normally these values describe the amplitude of the signal. Since 2 channels are used (left and right) I am not expecting negative values. Why do I get negative values and what is the purpose of them? 

2- I am using MovieAudioExtractionFillBuffer to extract audio data. I am also using SetMovieAudioExtractionCurrentTime to begin the extraction at a certain point in time. This is working well but I also to extract only the audio for a single video frame (not the rest of the audio movie from the time set by a call to SetMovieAudioExtractionCurrentTime . The only way to do this so far was to set the number of frames to extract in the call of MovieAudioExtractionFillBuffer. The problem is that I am not sure how to compute the number of frames needed for a single video frame. Currently, I am using the following formula:

    // Compute the duration of a single movie frame

    GetMovieTime ([mMoviePreview quickTimeMovie], &duration);
    duration.base = nil;
    GetMovieFPS ([mMoviePreview quickTimeMovie], &fps);
    duration.value.lo += duration.scale / fps;        

        

    // Now compute the number of audio frames for a single movie frame

    

    mSoundFrame = (mAudioDesc->mSampleRate) * (duration.value.lo / (duration.scale * 1.0));

    

    // Compute the frame buffer size

    lmcpSize = sizeof (Float32) * mSoundFrame;    

Thanks,

Claude Vezina
PCV
 _______________________________________________
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



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.