SimpleAudioEngine playEffect on Android ,sound stop after about 10s,and can not play to the end?

I use cocos2d-x-2.1.4 to create a android project,and write a most simple demo to test sound:

void HelloWorld::ccTouchesBegan(CCSet pTouches, CCEventpEvent){

SimpleAudioEngine::sharedEngine()->playEffect(“p1.ogg”);
}

“p1.ogg” is about 18s long. In win32 platform it runs ok,sound can play to the end. But in Android it stop after played 10s.

I change the sound format to mp3,wav, the problem still exit.

Thank you.

Have you solve this problem?

Have you tried your game on another Android device? I have a similar problem that SimpleAudioEngine performs differently on different Android devices. On Samsung Galaxy SII it runs OK, on the other device, the FPS drops while playing effects.

Hi there,
I still had the same issue, but found a solution to go around it. So I thought I might share it.
On android, effects are played for 10s only. You might play your sound using
playBackgroundMusic() instead. Then it works ! :slight_smile:
Hope it helps someone

Try AudioEngine instead of SimpleAudioEngine.

1 Like

yes AudioEngine is best rather then SimpleAudioEngine