Hello I am making a cocos2d side scroller. I am trying to add a background audio file. I am using SimpleAudioEngine. This is the code:
[[SimpleAudioEngine sharedEngine]playBackgroundMusic:@"Soundtrack.mp3" loop:YES];
But when I run it it gives me a error. The line that it says is giving me the error is:
[audioSourcePlayer prepareToPlay];
Is there a different way to add a sound file that won't give me this error?
The AVAudio and OpenAL will throw some exceptions, it's normal that the Xcode exception breakpoint triggers and nothing to worry about.
Instead of removing the exception breakpoint I highly recommend to "edit" the breakpoint and from the tiny edit dialog make sure you select that only Objective-C exceptions are caught. That way all the audio exceptions won't bother you (they're C++ exceptions) but you can still see where things crash should an assertion trigger.