car*_*rso 5 xcode avaudioplayer ios
我在模拟器上运行以下代码,我没有听到任何声音:
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"pageflip" ofType:@"mp3"];
NSURL *soundUrl = [NSURL fileURLWithPath:soundPath];
AudioServicesCreateSystemSoundID((__bridge CFURLRef) soundUrl, &_soundEffect);
AudioServicesPlaySystemSound(_soundEffect);
Run Code Online (Sandbox Code Playgroud)
代码已在xCode 5和iOS 7上成功测试.根据需要导入库.
我已经记录了soundPath,它返回了文件系统上的正确位置.
有没有人遇到过类似的问题?
| 归档时间: |
|
| 查看次数: |
5186 次 |
| 最近记录: |