Tuesday, June 3, 2008

QuickTime - converting Audio Formats

As I near the end of working through the output generation files I have come across the the issue of audio content. The Cello output file has sound embedded in it either as ADPCM or MP3. As Cello is a port from windows it has code that will covert from WAV (ubiquitous on Windows) to ADPCM. There is a converter class in Cello that backs onto some MFC APIs that takes care of this.

I have not done any work with sound but I figured that QuickTime might have the solution - digging around in the apple web-site in the Cocoa QuickTime sample code I found ExtractMovieAudioToAIFF that will extract a sound a movie and save it as an AFF file. QuickTime has a looser idea of what is a movie than you might think - a WAV file, for example, is considered to be a movie. The sample code as it stands will convert, for example, a WAV file to a AIFF file. It looks like I could use this code as a base or reference for converting between sound types.

I plan to postpone an work of converting sound files and will instead compile out the existing support for WAV files. I will do this as I can continue and get Cello working supporting just MP3 files. My priority is to get something working - and supporting a single audio format seems like a splendid start.

No comments: