Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SystemSoundID soundID = 0;
- CFURLRef soundFileURL = (CFURLRef)[NSURL URLWithString:somePathString];
- OSStatus errorCode = AudioServicesCreateSystemSoundID(soundFileURL, &soundID);
- if (errorCode != 0) {
- // Handle failure here
- }
- AudioServicesPlaySystemSound(soundID);
- SystemSoundID SoundID;
- NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"beep" ofType:@"caf"];
- NSURL *soundURL = [NSURL fileURLWithPath:soundPath];
- AudioServicesCreateSystemSoundID((__bridge CFURLRef)soundURL, &SoundID);
- AudioServicesPlaySystemSound(SoundID);
Add Comment
Please, Sign In to add comment