AudioServicesPlaySystemSound 不做任何事情,但 AudioServicesPlayAlertSound 使 iPhone 振动。
AudioServicesCreateSystemSoundID 返回成功。我正在运行 iOS4 的 iPhone3G 上开发。
有任何想法吗?彼得
=====
这是我创建声音的方法:
NSString *sndPath = [[NSBundle mainBundle] pathForResource:@"first_touch" ofType:@"wav" inDirectory:@"/"];
CFURLRef sndURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:sndPath];
int e = AudioServicesCreateSystemSoundID(sndURL, &_firstTouch); // TODO: call 'AudioServicesDisposeSystemSoundID'
这就是我玩的人:
AudioServicesPlayAlertSound(_firstTouch);