I create a new xcode project by template cocos2dx, and just simply add one line…
CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic(“new_music_01.mp3”, true);
to play background music, but It is silence …I try play .wav, It is the same situation, nothing happen…`@~
I trace the source…found in the CDAudioManager.m -(void) load:(NSString*) filePath
:
:
NSString *path = [CDUtilities fullPathFromRelativePath:audioSourceFilePath]; // auto show : path = `“new_music_01.mp3”
audioSourcePlayer = [(AVAudioPlayer*)[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error];
the error will ![](= nil, and
error._code = -43
error._domain = @“NSOSStatusErrorDomain”
What is the meaning ?
I do anything wrong ?
Please, Help me again…Thanks) (Run on Mac, test on simulator & iPhone 4s,iPad 2)