AudioServicesPlaySystemSound muted on simulator xCode 6 GM

橙三吉。 提交于 2019-12-21 17:24:04

问题


I run the following code on simulator and I don't get any sound:

NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"pageflip" ofType:@"mp3"];
NSURL *soundUrl = [NSURL fileURLWithPath:soundPath];

AudioServicesCreateSystemSoundID((__bridge CFURLRef) soundUrl, &_soundEffect);
AudioServicesPlaySystemSound(_soundEffect);

The code has been successfully tested on xCode 5 and iOS 7. Libraries imported as required.

I've logged the soundPath and it returns the correct location on the filesystem.

Has anyone experienced a similar issue?


回答1:


This is an issue with the simulator. On a device it'll work as expected.




回答2:


I have a similar issue now. My AudioServicesPlaySystemSound was working until the XCode update to 6.0.1. One could assume that there is something broken in the update.



来源:https://stackoverflow.com/questions/25859337/audioservicesplaysystemsound-muted-on-simulator-xcode-6-gm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!