rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
459 stars 50 forks source link

Sound events #50

Open karneaud opened 7 years ago

karneaud commented 7 years ago

Do I have access to any of the sound events? I need to trigger actions based on time update or play/ stop

rezoner commented 7 years ago

You should build something custom on top of WebAudioAPI - it's rather simple and it will give you a full control over the sound. Also I would not rely on any events coming from Audio - I would rather hold lengths of the sounds somewhere and call what's needed using setTimeout or tracking delta. Sound is there to reinforce the UX and building game logic upon sound API is asking for troubles.

karneaud commented 7 years ago

Will this is a killjoy...I need sound events to drive my game. I've tried p5js which has a nice sound api but its Implementation lacks some compatibility. But I know what I want to do can be achieved.