【发布时间】:2014-09-16 01:25:11
【问题描述】:
我在模拟器上运行以下代码,但没有听到任何声音:
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"pageflip" ofType:@"mp3"];
NSURL *soundUrl = [NSURL fileURLWithPath:soundPath];
AudioServicesCreateSystemSoundID((__bridge CFURLRef) soundUrl, &_soundEffect);
AudioServicesPlaySystemSound(_soundEffect);
代码已在 xCode 5 和 iOS 7 上成功测试。根据需要导入库。
我已经记录了 soundPath,它返回了文件系统上的正确位置。
有没有人遇到过类似的问题?
【问题讨论】:
标签: ios xcode avaudioplayer