Simple audio engine not playing audio on actual device. Plays it on simulator though

564 views Asked by At

I am trying to integrate background music into my cocos2d game using simple audio engine.

I use the playBackgroundMusic method of simple audio engine

here is the line of code I use:

[[SimpleAudioEngine sharedEngine]playBackgroundMusic:@"Soundtrack.mp3" loop:YES];

I also imported the SimpleAudioEngine header file. I have the code in my GameEngine class.

1

There are 1 answers

0
CodeSmile On

If you try to play Soundtrack.mp3 make sure the file is actually named Soundtrack.mp3 and not soundtrack.mp3 or SoundTrack.mp3.

The iOS file system is case sensitive. The Mac's (Simulator's) file system is not. Ergo it will play on the Simulator but not on the device. Case matters.