You are not logged in.

Scott Witte


  • "Scott Witte" started this thread

Posts: 272

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message


Friday, November 15th 2019, 12:37am

New Soundinterface Tweening Issue


I'm loving the WebAudio soundinterface but have found a curious tweening issue.

Say I want to play a sound/song but want to ease into it. I should be able to start playing it with a volume of 0 and then tween the volume to, say, 0.5. But I find that if the sound isn't preloaded the tween starts at 1 and tweens down to 0.5. However, if I delay tweening by at least 0.5 seconds after starting to play at vol 0, the tweening starts at 0 and fades up to 0.5 as expected.

For testing these are local files, so the "download" speed isn't a factor. I know that with WebAudio the sound won't even start playing until fully downloaded. So there is something more involved here because it seems that for the first half-second or so the sound can only play a 0 or 1 volume.

If I preload a sound and that sound is the first played, no matter how long you wait before playing, it will start the tween at a volume of 1 unless you wait at least 0.5 seconds before starting the tween. After any sound has already played, as long as a sound is preloaded (or has played before), you can immediately start tweening up to your target volume.

My workaround is to play a bit of silence as soon as a tour loads. Then, as long as a sound is preloaded I can immediately start at volume 0 and tween up to my desired volume. BTW, streaming that bit of silence doesn't work for this.

Is this a bug? Am I missing something, or is this how it is supposed to work?