rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.89k stars 160 forks source link

Making play a Promise #86

Closed frastlin closed 6 years ago

frastlin commented 6 years ago

Hello, Would it be possible to make play a Promise? I have some situations where I need to play sounds one after another and at the moment, I can only do this by setTimeout(callback, sound.decodedBuffer.duration) Being able to use await would save a lot of extra coding on my part and would make the play function very useful for split scenes, footsteps, or any sequential sounds.

rserota commented 6 years ago

In the latest version of Wad.js, play() now returns a promise.

Thanks for the suggestion.