I'm trying to create a music based game (similar to "my singing monsters). the idea is that I have a scene where I can place and remove a few different characters from the scene, each character has a unique mp3 file for its singing.
I'm building my game with cocos2dx though for sounds I'm using a custom engine which currently uses MediaPlayer API on android. In order to sync all the sounds together I just play them all when the scene is loaded and then just mute and unmute according to which character is on scene. the problem is that on older devices the sounds seems to be out of sync, I assume that I need a way to pre-cache the mp3 files before they are loaded.
I tried creating all the mediaPlayers in advanced and use the prepare() method, then save them in a hashmap and just use play() when the scene is started to play them all. unfortunately it didn't work and the tracks are still out of sync. I'm not sure how MediaPlayer work so I don't know if trying to create it in advanced is equivalent to pre-caching. The standard cocos2dx sounds engine uses soundpool which I understand is not good for large files and I'm not sure if it has a caching mechanism. On Ios I already had a sounds engine that uses openAL and on the ipad 4 I tested it works just fine.
What do you suggest I do in order to sync the tracks? implement another sounds engine? maybe based on openSL? or somehow keep a timer and use it to sync tracks.
How would design the sound for such a game where it is the most important thing to have all the tracks synced together?