AudioServicesPlaySystemSound disabled on xCode 6 GM simulator

I run the following code on a simulator and I get no 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 are imported as needed.

I started soundPath and returned the correct location on the file system.

Has anyone encountered a similar problem?

+5
source share
2 answers

This is a problem with the simulator. On the device, it will work as expected.

+8
source

I have a similar problem. My AudioServicesPlaySystemSound worked before upgrading Xcode to 6.0.1. It can be assumed that something is broken in the update.

+3
source

Source: https://habr.com/ru/post/1202637/


All Articles