[EOS/CODE] Fading an Audio play action's volume in and out
Posted: Wed May 19, 2021 3:17 pm
Here's a demo that adds a "fadeTo" method to Eos Sound objects allowing you to fade volume in and out:
Demo URL:
https://milovana.com/webteases/showteas ... d056925dc0
Demo JSON (right-click save-as):
https://milovana.com/webteases/geteossc ... d056925dc0
To install the fadeTo method in your own tease, you'll need the "1-minute-of-silence.mp3" file, and the first two IF actions in the start page of the demo.
Example use:
Changelog:
Demo URL:
https://milovana.com/webteases/showteas ... d056925dc0
Demo JSON (right-click save-as):
https://milovana.com/webteases/geteossc ... d056925dc0
To install the fadeTo method in your own tease, you'll need the "1-minute-of-silence.mp3" file, and the first two IF actions in the start page of the demo.
Example use:
Code: Select all
// If we haven't loaded our sound into a global variable, do it now
if (!window.mySound) window.mySound = Sound.get('test')
mySound.fadeTo(1, 2000) // fade to full volume over 2 seconds
- Spoiler: show
- Spoiler: show