mbostock/stack

Associate sound tracks to the slides.

Closed this issue · 3 comments

drio commented

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 the s 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

You should be able to do this using activate / deactivate events.

drio commented

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.

drio commented

I have released the extension here. Just in case you want to reference it in your README. Thanks again for the help.