// Play sound
//To load sound file.
+(void) playSound:(NSString *)fileName {
NSString *path = [NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] resourcePath],fileName];</code>
<code>//declare a system sound id
SystemSoundID soundID;
//Get a URL for the sound file
NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
//Use audio sevices to create the sound
AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
</code>
<code> //Use audio services to play the sound
AudioServicesPlaySystemSound(soundID);
}