I am trying to play a background music for a scene of a game I am developing using Cocos2d 2.0
but the execution stops at
in CDAudioManager.m:
-(void) load:(NSString*) filePath {
........
.........
[[audioSourcePlayer prepareToPlay]; //This is where the execution stops!!
and it gives NO details about the exception!, it just breaks!
and this is how I am playing the music:
NSString *soundFile = [[NSBundle mainBundle] pathForResource:@"background_music" ofType:@"mp3"];
NSLog(@"soundFile: %@", soundFile); //The path is correct
SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine];
if (sae != nil) {
[sae preloadBackgroundMusic:soundFile];
if (sae.willPlayBackgroundMusic) {
sae.backgroundMusicVolume = 0.5f;
}
}
I am using Cocos2d 2.0, Xcode 4.5.1, iOS SDK 6.0