Closed drio closed 10 years ago
You should be able to do this using activate / deactivate events.
Sounds are triggered when user presses 's' and stopped if they transition to another slide while the sound is still playing.
I thought that would be better than firing up the sound automatically for each slide. This way the user can decide when to play the sound.
Hi @mbostock ,
I wanted to associate explanations to my slides so I added sound support to stack.
When loading, stack tries to pull the sound associated to each slide. The convention is pretty straight forward; sounds have to be under sounds/ and have to be named:
(\d+).mp3
, where(\d+)
is the number of the slide. Right now the user can play the sound for a slide hitting thes
key. When transitioning between slides the sound will stop.The component that implements all the sound logic is pretty self-contained. I have minimally modified
stack.js
to add the necessary calls to the sound component.You can see all these in action here. Warning: I have only added sounds to the first three slides.
If you find this interesting I can prepare a pull request. Let me know,
-drd