Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AudioServicesPlaySystemSound muted on simulator xCode 6 GM

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?

like image 324
carlodurso Avatar asked Sep 16 '14 01:09

carlodurso


2 Answers

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

like image 88
carlodurso Avatar answered Oct 03 '22 08:10

carlodurso


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.

like image 32
Frankeex Avatar answered Oct 03 '22 07:10

Frankeex