umnute button
Audio Nerd Lab

JavaScript with ears

I recently learned about the pretty amazing JavaScript WebAudio API. That’s a cool name for a Programming Interface that allows you to do all kinds of fun things with sound in your web browser.

For example, you can plug in audio effects on music that is streaming. Or, as I did in this case, have an analyzer listen to your music.

If you click the speaker icon above, the song ‘Albnd Zwecks‘ by Olaf Wempe will start to play. WebAudio analyzes it as it plays, and returns a bunch of numbers that I can use to animate the scene in real time.

Technology

Animation created with babylon.js, controlled with audio

My favorite WebGL 3D-library babylon.js is used to draw the scene. Then I light up 300 moons in sync with the music 🙂