我想播放系统声音,但我什么也没听到:
- (void) play_system_sound
{
NSLog(@"Play system sound");
SystemSoundID soundID;
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.UIKit"] pathForResource:@"Tock" ofType:@"aiff"];
NSLog(@"path = %@", path );
AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &soundID);
AudioServicesPlaySystemSound(soundID);
AudioServicesDisposeSystemSoundID(soundID);
NSLog(@"Play system sound DONE");
}
我什么也听不见。我究竟做错了什么?