I am using the playBackgroundMusic()
method to play my music files.
I have set the loop parameter to true.
I have tried the following formats:
The problem is that the file is looping, but it is not looping seamlessly on android devices.
It loops perfectly well on iphone anf ipad.
Every-time the file end is reached, there is a small gap and then it plays again.
The gap is about a fraction of a second, but still noticeable.
I have tried 5-6 different sounds and also changed the formats. No Luck!!
I have also build the "Tests" project that comes with the cocos2d-x library, on my android device and played the CocosDenshion Test.
It seems that even that one is having a problem with seamless looping.
Has anyone tried this??
I would really appreciate if any one pitches in with their idea. :)
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-x 1.0.1-x-0.11.0
version.
Which is the latest.
I am new in stackoverflow. I am using cocos2d-x 3.1 and following code is working perfectly fine:
CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic("music.ogg", true);
Try to port your code to newer version of cocos2d-x. I hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With