Audio
Volume Control Alert
If you need a quick and dirty volume control, an alert specifically tailored for this purpose is included in the MediaPlayer framework. The alert looks as follows:: To display the alert, adding the following code and include the MediaPlayer framework in your project:
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 [...]
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);


