How to create a audio bucle on CocosDenshion SimpleAudioEngine

Bon jorno.

I’m trying to manage audio in my game. I have a mp3/ogg music file that must sound everytime. I use for this:

SimpleAudioEngine::sharedEngine()->playBackgroundMusic(std::string(myFileUtils->fullPathFromRelativePath(musicFileWithExtension)).c_str(), true);

Its work, but i would like not to repeat all the file, just from sec 30 in advance.

Example:

First time: 0:00 —> 3:20
Others: 0:27 —> 3:20

Is this possible or i have to use 2 different files cutting the main file?

It is not supported in CocosDenshion now.
You should modify the codes to fit your need or you should offer two files.

Ok, i used CCArray to call 2 pieces 1 after 1, repeating the second one after reproduction and work fine :wink:

Thanks