The purpose of this project is to create a C++ library for OS X that will extract the audio from a media file using QuickTime. Apple provides sample code for the functionality, so the work required is to adapt that code to our interface specifications.
1. The media file is usually a video file but could be any video/audio file that QuickTime can handle.
2. Audio does not just get extracted in its native format. It also needs to get reliably converted to a prescribed format (e.g., mono, 48kHz sample rate, aiff).
3. QTKit is preferred, but the code can be written in Carbon or Cocoa or whatever makes the most sense. But it has to be callable from C++.
4. Apple has provided several code samples with similar functionality. One example is linked to below. Some of their examples are pretty old, so while the right sample can provide an excellent starting point, the wrong one could be somewhat out of date. The delivered code must not rely on any deprecated interfaces (like NSMovie).
5. Needs to be thread-compatible to the extent that it can support having a callback to report progress. The links below have more information and sample code.
6. Can assume that QuickTime 7 is installed.
7. The library interface will specified in detail. It will be modeled on the open/read interfaces provided by libsndfile (see link below) for audio files:
* sf_command > SFC_SET_NORM_DOUBLE
8. Error handling is via std::runtime_error exceptions
9. Use of the Boost libraries, where appropriate, is strongly encouraged.
10. Inputs to the library include:
* path to the media file,
* format specification,
* buffer to store the results,
* the number of audio samples to be read.
Useful Wikipedia overview of QuickTime: [url removed, login to view]
QuickTime threading: [url removed, login to view]
QuickTime audio extraction sample code: [url removed, login to view]
Another example with progress callback: [url removed, login to view]
libsndfile API: [url removed, login to view]
A test program illustrating the use of the library is a requirement. It will have the following general architecture:
Cocoa -> C++ dylib -> audio extraction dylib
- input: path to media file
- process: reads all audio samples but doesn't do anything with them
- shows a progress meter (managed by Cocoa app)
- cancel button