I'm making a game in Cocos2D iOS and would like play a short audio clip (in .m4a format) when the launch image (Default) is displayed.
I tried adding this line:
[[OALSimpleAudio sharedInstance] playBg:@"clip.m4a"];
in application didFinishLaunchingWithOptions but doesn't work.
I also tried playing a .caf file instead of .m4a, but it also doesn't play.
Can you guys please help me in this regard?
Thanks a lot!
Are you talking about the default loading screen that is defined in your project settings as 'default.png'? If yes, I don't think it's possible to play a sound at the same moment the app is launched, because it is currently loading it. What you could do however is a IntroScene that would only implement the
onEntermethod and immediately apply a transition to, example, your Main Menu. This is what I am doing right now in my game (using cocos2D 2.1, but I guess this isn't very different from a version to another) :Hope this helps! :)