Issue while looping sounds using playBackgroundMusic Method



I am using playBackgroundMusic() method to play my music files. I have set the loop parameter to true. I have tried (.wav, .ogg, .mp3, .mp4, .m4a) formats.
The problem is that the file is looping but it is not looping seamlessly on android devices. It loops perfectly well on iphone, ipad.
Every-time the file end is reached there is this small gap kinda things and then it plays again. The gap is for a fraction of a second but noticeable. I have tried 5-6 different sound and also changed the formats. No Luck

I have also build the “tests” project on my android device and played the CocosDenshion Test. It seems that even that is having a problem with seamless looping.

Has anyone trEed this?? I would really appreciate if any one pitches in with their idea. :slight_smile:

If i use playeffect() then the sound loops but i do not want to use playeffect for playing music files.

NOTE :- I am using cocos2d-1.0.1-x-0.11.0 version. Which is the latest.


Same problem in Windows && iOS: if trying to loop a sound, always sound a “gap” in the end (WAV, MP3, …).
Version: cocos2d-1.0.1-x-0.12.0 @ Mar.5 2012

Any solution, please?


+1 for solution. Have the same issue on ios


I hate to bump this old topic, but has there been any breakthrough with this issue?

Cuz I’m still having this problem. :frowning:


I run CocosDenshion in my g10, but it works ok.


Version: cocos2d-2.0-x-2.0.3 @ Sep 26 2012

Got this problem, too.

If the end of the music/effect comes, it closes a thread and starts it again, causing the complete App
to lagg for about 0.5 secs.

Looping sound Effects for Timers, watches is impossible.

Testet on Windows.
Test for IOS /ipads and Iphone incoming, maybe Android.
Ill reply maybe tonight.

Test on IOS, working fine. no laggs there.