Re: Starting with coreaudio API (beginner)
Re: Starting with coreaudio API (beginner)
- Subject: Re: Starting with coreaudio API (beginner)
- From: Jens Alfke <email@hidden>
- Date: Sat, 15 Oct 2005 23:11:51 -0700
On 15 Oct '05, at 8:22 AM, Jacob Ashcroft wrote: All I've done so far is use sysbeep. I would like to use some wav files I've got, I've skimmed throught the documentation on the Core Audio API though don't really know where to start.
If you just want to play some short sounds, you can do that easily with the NSSound class:
NSSound *sound = [[NSSound alloc] initWithContentsOfFile: @"/Path/To/File.wav" byReference: YES]; [sound play]; [sound release];
If you want to do more, download the CA SDK. The "PublicUtility" folder contains a bunch of useful utility classes / sample code that you can build and tinker with. In particular, the CAAudioFilePlayer class will play arbitrarily long sound files of most any format, using a secondary thread for buffering. This was really helpful to me.
In Tiger there's also a new AUAudioFilePlayer audio unit. It looks very powerful, but I haven't tried it out yet. The only documentation seems to be a large block comment at the bottom of AudioUnitProperties.h.
--Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden