Version: 1.0

Posted: 2006-11-08

Build Requirements: Xcode 2.3 or greater using the Mac OSX 10.4 Universal SDK

Runtime Requirements: Mac OS X 10.4.7, QuickTime 7.1.3

View Source Code:

Download Sample (“QTExtractAndConvertToMovieFile.zip”, 115.3K)
Download Sample (“QTExtractAndConvertToMovieFile.dmg”, 173.2K)



Description

QTExtractAndConvertToMovie contains two Objective-C objects that are used together to implement audio extraction and audio conversion from a QuickTime Movie sound track to a movie file.

The first is a simple class called MovieWriter (this is a modified version of the AIFFWriter class that was included with the ExtractMovieAudioToAIFF and QTExtractAndConvertToAIFF samples). MovieWriter uses QuickTime's Movie Audio Extraction, Movie Storage and Media Creation APIs. The second is another simple class called AudioConverter which encapsulates Core Audio's Audio Converter API.

The sample uses an instance of the MovieWriter class to easily set up audio extraction from a QTKit QTMovie to a new destination Movie and its associated movie file (or movie storage as it's called in the API). MovieWriter uses an instance of the AudioConverter class to perform the conversion to a user selected destination format which is configured by the Standard Audio Dialog Component. The Audio Converter uses a Movie Audio Extraction Session in the Read Input Procedure to pull audio out of the source Movie. AddMediaSample2 is then used to add the converted audio to the movie storage.

This sample supports VBR as well as CBR audio encoding formats.

IMPORTANT NOTE FOR QUICKTIME DEVELOPERS:

While this example demonstrates using the Audio Converter APIs directly, QuickTime developers may want to consider using the crossplatform SCAudioFillBuffer API introduced in QuickTime 7.1. SCAudio is built on top of Core Audio and incorporates a mixer into its chain, so it can perform mix-downs in addition to encodes, decodes, and transcodes. It also maintains an interface identical to AudioConverter's AudioConverterFillComplexBuffer.

See the SCAudioCompress sample for more details.

Document Revision History

Date Notes
2006-11-08Demonstrates using MovieAudioExtraction and an AudioConverter to extract and convert audio to a QuickTime movie file.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.