Gan_HOPE326 Posted December 30, 2014 Share Posted December 30, 2014 Hi all, I'm looking into the possibility of using music to influence what happens in my Phaser.js coded game. Something like what's seen in Beat Hazard, Crypt of the Necrodancer etc. - rhythm interaction with the peaks of intensity/frequency in the music that's playing trigger a response in the game. Is it possible to do this entirely inside Phaser? And if it is, how can I access the properties of the currently playing sound, or even its whole raw sample data, to do it? Thanks a lot! Link to comment Share on other sites More sharing options...
oddskill Posted December 31, 2014 Share Posted December 31, 2014 Hi. I guess you have to write your own filter to extract the peaks. http://www.html5rocks.com/en/tutorials/webaudio/intro/ I dont know how exactly Audio is implemented in Phaser, but how general acess to the webaudio realtime buffer is done you can see here http://noisehack.com/custom-audio-effects-javascript-web-audio-api/ You just have to find the peaks in the buffer instead of manipulating it like in those examples. best regards odd Link to comment Share on other sites More sharing options...
Recommended Posts