Audio
iPhone Developer Tips Stats:
|
Playing Sounds/Audio – AVAudioPlayer
I previously wrote about using Audio Session Services which offers a quick and easy approach for playing short sounds. However, there are a number of limitations, including no control over the volume, playing time is limited to 30 seconds and the only file types supported are AIFF, WAV and CAF.
Sounds with AVAudioPlayer
AVAudioPlayer offers a much [...]
Silent Mode Switch and Playing Sounds
In a previous tip, Playing Short Sounds, I wrote an example to show how you can play a short sound, up to 30 seconds, by calling one of the C-based functions in the Audio Session Services library.
There is one aspect of this that can be troublesome – by default, playing an Audio Session sound [...]
Playing Sounds/Audio – Audio Session Services
If you need to play short sounds, less than 30 seconds, Audio Session Services are your friend. Here is a snippet of code to play a wav file:
SystemSoundID soundID;
NSString *path = [[NSBundle mainBundle]
pathForResource:@"RapidFire" ofType:@"wav"];
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path],&soundID);
AudioServicesPlaySystemSound (soundID);








