If you use the correct beep and play sound on the device, then the code you submitted should work.
Alternatively, you can use the following code to play a custom sound or audio file if this helps you
- (IBAction) playSystemSound: (id) sender { NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"audio" ofType:@"mp3"]; SystemSoundID soundID; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath: soundPath], &soundID); AudioServicesPlaySystemSound (soundID); }
Apple has provided sample code for playing sounds that you can also test.
source share