Possible Duplicate:
play sound on iphone even in silent mode
I'm trying to play a short sound (which denotes the completion of a timer) and have implemented it as a system sound. Since my app is a timer, I would like for the sound to be audible even if the mute switch is enabled.
// Load the sound
NSString *path = [[NSBundle mainBundle] pathForResource:@"tinshaw"
ofType:@"wav"];
NSLog(@"tinshaw: %@", path);
NSURL *pathURL = [NSURL fileURLWithPath:path];
// Create a system sound object representing the sound file.
AudioServicesCreateSystemSoundID ( ((__bridge CFURLRef)pathURL), &completionSound);
// Play the Sound
AudioServicesPlaySystemSound(completionSound);
I have tried changing the audio session category to "AVAudioSessionCategoryPlayback", but that didn't work. Is there