Re: from (Aiff.h || soundmanager) to OS X
Re: from (Aiff.h || soundmanager) to OS X
- Subject: Re: from (Aiff.h || soundmanager) to OS X
- From: Ian Ollmann <email@hidden>
- Date: Tue, 4 Sep 2001 08:23:28 -0700
I was just playing with this this weekend for pretty much the same reason.
Quicktime plays AIFF just fine. Please see TN 1198 for how to do that. It
is pretty simple.
The commonChunk.sampleRate is an extended80. You can use x80tod to
convert it to a double, and from there to a 16.16 fixed, which is what
things like rate22khz are.
UInt32 rate = (UInt32) (65536.0 * x80tod( &commonChunkPtr->sampleRate ) );
The basics of AIFF file format are covered in Inside Macintosh: Sound.
You can also try the Carbon call ParseAIFFHeader(), which may save you
bunches of time and bugs. Parsing the header is only half the battle
though. You then have to covert the many data formats to the preferred
audio format for CoreAudio. If you have 10.1 installed, take a look at
AudioConverter.h. You can also try the Carbon Sound Converter, though it
can be a bit tricky to use correctly.
Ian
---------------------------------------------------
Ian Ollmann, Ph.D. email@hidden
---------------------------------------------------