rserota / wad

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

Audio visualiser with WAD #105

Closed shantee closed 4 years ago

shantee commented 5 years ago

Hello I would like to know how could I easily get some data from a music to create a visualizer. I understand how to use the "pitch" (i found the answer on SO). But is it possible to for example detect "beats" or spectrum ?

rserota commented 5 years ago

I'm sure it's possible, but I don't know exactly how to do it. You'd probably start by adding a bunch of wads to a PolyWad, so that all your audio is routed together. From there you'd have to get a bit more low level with the web audio api, and add an analyser node to the PolyWad's output so you can examine the audio data. The analyser node has a handful of methods that you can call to examine the live audio data, but I've never actually done anything interesting with it. You can probably find some guides online that describe the process well enough, and there are probably better tools than Wad.js as well.

rserota commented 4 years ago

In the latest version of Wad (4.7.0) PolyWads can have an audio meter which reports their volume level. That should give you the data you need to build a visualizer. There's an example in the docs.