【发布时间】:2010-09-24 22:45:58
【问题描述】:
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);
【问题讨论】: