iiYO Community

Full Version: Music doesn't loop
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello again!

I am having problems when playing music in my game. I use "+loop" but somehow, the music doesn't loop (and it doesn't seem to fade as well). Is there something I am doing wrong?

Code:
. audio name prueba, +loop, +fade :
   . track title lumias :
       . source href assets/audio/586814_Lumias-Grove.mp3, type mp3
       . source href assets/audio/586814_Lumias-Grove.ogg, type ogg
   --
   . track title orbit :
       . source href assets/audio/561584_In-Orbit.mp3, type mp3
       . source href assets/audio/561584_In-Orbit.ogg, type ogg
   --
   . track title sadness :
       . source href assets/audio/590933_Piano-Loop--Sadness.mp3, type mp3
       . source href assets/audio/590933_Piano-Loop--Sadness.ogg, type ogg
   --
   . track title adventures :
       . source href assets/audio/684976_Crystal-Shard-Adventures.mp3, type mp3
       . source href assets/audio/684976_Crystal-Shard-Adventures.ogg, type ogg
   --
   . track title passions :
       . source href assets/audio/73556_newgrounds_passio.mp3, type mp3
       . source href assets/audio/73556_newgrounds_passio.ogg, type ogg
   --
   . track title medley :
       . source href assets/audio/157729_PianoMedley2.mp3, type mp3
       . source href assets/audio/157729_PianoMedley2.ogg, type ogg
   --
   . track title troisieme :
       . source href assets/audio/631377_Troisime.mp3, type mp3
       . source href assets/audio/631377_Troisime.ogg, type ogg
   --
--
Hi Kozelek,

I investigated this a bit. It seems the problem is that the audio element expects "true" as its value, whereas with "+loop" it is set to "yes" instead. So this is a bug in the test file for the audio element (tests/audio/game.xml).

I think I'll change the code so that the engine treats "true" and "yes" in the same way. In the meantime, the workaround is to just use "loop true" instead of "+loop".

Hope this solves your problem!

EDIT:

It's the same with the "fade" attribute.
Thanks a lot! Now it works wonderfully Smile