solución a bug para reproducir música y efectos

Logre reproducir bien música y efectos de la siguiente forma:

Precargandolos así: (note la diferencia entre la música y los efectos)

cc.AudioEngine.getInstance().init();
cc.AudioEngine.getInstance().preloadEffect(“res/effect2”);
cc.AudioEngine.getInstance().preloadMusic(“res/background.ogg”);

Y llamando la función así:

cc.AudioEngine.getInstance().playEffect(“res/effect2.ogg”,false);
cc.AudioEngine.getInstance().playMusic(“res/background”,false);

de esta forma soluciona todas la reproducción de música y efectos.

Hi,

I also noticed that sound effects did not play immediately, but I tried your fix and it didn’t make any difference for my game :(
One other thing, I think its not clear and I’ll post it in another posting, is that playEffect will only play .ogg files and seems to ignore the file extension in the code, ie it strips the extension and replaces it with .ogg, so unless you have a .ogg version, the sound effect doesn’t play :
(