Re: CoreAudio & QuickTime
Re: CoreAudio & QuickTime
- Subject: Re: CoreAudio & QuickTime
- From: Kurt Revis <email@hidden>
- Date: Mon, 10 Dec 2001 03:41:43 -0800
CoreAudio is a great API for sound processing, but I'm missing
something: a standard way to decompress sound files.
It'd be great to be able to use QuickTime for decompressing/converting
all
the sound file formats it supports to a stream of data CoreAudio can
understand. I guess that this should be possible, but I have absolutely
no
idea how... anyone?
You want to use the SoundConverter in QuickTime. It can convert from
any file type QT can read, into raw integer data. (Unfortunately I don't
think it'll go all the way to floating point, but you can easily use
CoreAudio to convert from FP to integer.)
You might also want to look at the archives of the QuickTime mailing
list, for messages from Tim Wood from about a year or two ago--he got QT
decompressing MP3 files and played them back through CoreAudio. He has
a link to some sample code, which unfortunately is a litte old and
doesn't work anymore (it was for Mac OS X DP4!), but it should give you
the idea.
(There's also some QT example code on Apple's developer site; at least
one of the MP3 player examples uses SoundConverter.)
Also, here's some of my code, based on Tim's and the QT examples, which
uses SoundConverter to convert a file to AIFF. It's not good code by any
means, but it does basically work.
<
http://www.snoize.com/SoundConverterTest.c>
--
Kurt Revis
email@hidden