Sound effect won't play on iOS (iPad2)

I tested a simple app to start playing sound effect immediately at the start. Tested on Windows phone 7, and PC seems to be fine.
But on iOS (on iPad2), no sound effect is played.

I checked it by testing against a testcase (http://www.cocos2d-x.org/cocos2d-html5/index.html), and it plays sound fine.
You can test my simple app at http://tkappport.comli.com/prototype/. It will render background and play a sound effect.

Any suggestion on what might be a problem?

its a known limitation on ios, which have very limited support for audio API, we are currently looking for a workaround

Thank you Hao Wu! Looking forward to it.

By the way, I believe that the current version is not optimized and stable for mobile, but rather target on PC. If that’s correct, could you tell me roughly how long it will be stable for mobile production?

Thanks for cocos2d-x and cocos2d-html5’ I’m currently using both of them.

As the result of performance and limitation, it will be a long term to improve cocos2d-html5 for mobile production. You may use “cocos2d javascript binding” instead.

I’m not familiar with original cocos2d. Could you give me some links to download that framework? I’m not sure I got the correct one. Sorry for my fuzzy, I really need a stable alternative based on cocos2d to develop on mobile. Thanks!

there will be very limited html5 support and performance from default browsers on ios and android.
my theory is that they want to push their own appstore and gets a cut in IAP.

But, our Cocos2d-x team and zynga is working on javascript binding for both cocos2d-x and cocos2d-iphone.

you do not need to have experience to use them, as your game written in cocos2d-html5 should work straightly on cocos2d-x and -iphone.

so for mobile, if it is not graphic intensive, cocos2d-x should work great, otherwise, keep working on cocos2d-html5, the javascript binding will be finished pretty soon

Yes, thanks for info Hao Wu!
I believe the same as you that if it’s not graphics intensive, I should go on and use cocos2d-html5, and I would love to stick to it. Only the problem I have now is only the sound effect that won’t play on ios, others are okay either pc, android, windows phone.

Cheers for hard working, I will be looking forward to its stable binding!

I tested more, and I have found that the sound effect in case for what I mean won’t play whenever it’s the first sound effect to play automatically after load a very first (truly first) scene.

I have to add a button, simulate a touch event first then it will play sound with no problem.

So the problem’s solved now. Keep rocking guys!

Bumping this thread.
I’m also having some problems with the audio on iPad 2. Have you guys fixed or improved anything audio related since last this last post 9 months ago, or having any ideas why it won’t work for me?
I have been trying to include mp3, ogg, m4a(ACC) files to my project, but SimpleAudioEngine seems to prefer the mp3 file on my ipad2. But it then fails to load and play.
using version 2.0.

thanks

I guess it’s due to iOS’s policy to play sound effect. It’s that way.
You probably have to take a look at other audio library such as Buzz. I used in one of my project and it’s best for me out there. Simple to integrate, and can play mp3, ogg, and wav. Testing on devices has better chance to play audio correct in timely manner than pre-installed SimpleAudioEngine.

EDIT:
Anyway, playing a loop sound on iOS is still pain in the ass. You should play loop sound via your native app that wraps your HTML5 app. For sfx, you play it via your HTML5 app.

Ah cool. Thanks for your fast reply. Then you can just ignore my tweet : )
I will try out Buzz then and hope it plays my soundeffects for me.

Wow it worked!
Awesome man, thanks for the help! It’s now working as it should :slight_smile: I even bought mr Salvat a beer on his site.
I should really buy you one as well :stuck_out_tongue:

Glad that helps!