- Create a project and add AudioToolbox.framework reference.
- To play the system sound, call AudioServicesPlaySystemSound(1104) where "1104" is the system sound ID.
- For the complete list of system sound, you may refers to http://iphonedevwiki.net/index.php/AudioServices
You might found the following sample code (somewhere in the Internet) which load the "Tock" sound from the system resources and plays it. But, the following code might not play the sound because you should not call "dispose" function immediately after "play" function as the play function will take some time to execute the "playing" process. This results in the soundID has been disposed/reset before it has been played. The correct way is to call the dispose function when you are unloading the view or app.
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.UIKit"] pathForResource:@"Tock" ofType:@"aiff"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &soundID);
AudioServicesPlaySystemSound(soundID);
AudioServicesDisposeSystemSoundID(soundID);