Author Topic: Snd looping and Delay Solution  (Read 702 times)

kalani96746

  • Newbie
  • *
  • Posts: 6
Snd looping and Delay Solution
« on: June 17, 2009, 08:34:15 am »
Hopefully this helps someone.

I needed to modify the Audio class to get delay and fading working how I had expected them to work.

In other words in my head delay should be the amount of time before the sound begins to play and fade should be the amount of time sound fades in or out after the sound begins to play.

If the delay is 1 second and the fade is 0.  The audio will start playing 1 second into the sound but the first second of audio would have already played (but just like the sound was off).
Instead my version starts the sound at the beginning after 1 second so you don't miss anything.

Also I set up sound so that it doesn't loop by default adding a new loop="false" to the Audio object.  See http://megazine.mightypirates.de/forum/index.php/topic,214.0.html for more info.

Maybe this was just a bug that never got fixed, anyhoo if anyone wants it I've attached this class to the email.  You'll need to know how to compile from sources.

kb

[Edit: fixed Audio.as last minute Audio playing over each other on page turn.  Re-attaching.  Download the second one in the list below.  It doesn't let me delete attachments]
« Last Edit: June 17, 2009, 08:52:44 am by kalani96746 »