esonderegger / web-audio-peak-meter

Customizable peak meters, using the web audio API.
https://esonderegger.github.io/web-audio-peak-meter/
MIT License
125 stars 33 forks source link

Visual output peak meter #52

Open Elgoritm opened 1 year ago

Elgoritm commented 1 year ago

Hey there!

Was wondering if would be possible to output the peak meter levels in a different way, for instance like this?

R 1db6b0f79bfc1a473e400a3bc3aeb726

Being able to have to have a meter that lights up for instance per 3dB would be cool.. is there an output that could be used for this?

esonderegger commented 1 year ago

If you wanted to build something like this using the web-audio-peak-meter library, you definitely could - by wrapping the getPeaks method in a requestAnimationFrame loop.

If you want to go this route, I'd recommend checking out the Usage without a DOM node example.

However, the parts of the code that create an audio worklet node and measure the input are relatively simple. You might want to copy the relevant bits from peak-sample-processor and have everything live in your source code without needing to add this library as a dependency.