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?
This is an issue with the simulator. On a device it'll work as expected.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With