Skip to content

cwilso/volume-meter

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
January 27, 2014 10:24
March 27, 2017 09:39

Simple volume meter

I whipped this app up to show a basic volume meter on live audio input. It does both clip detection and RMS volume.

A "volume" meter can mean many things; if you want to do clip detection, you really need to access every sample. If you don't need clip detection, I might suggest using an Analyser and getByteTimeDomainData, since it will likely have lower CPU overhead. Note that it is CRITICALLY IMPORTANT to disassociate visual rendering (in the requestAnimationFrame loop) from the onaudioprocess function - you do NOT want to trigger a relayout from inside your audio handler, or it may glitch or cause other issues.

It's also hosted at https://webaudiodemos.appspot.com/volume-meter/.

Check it out, feel free to fork, submit pull requests, etc. MIT-Licensed - party on.

-Chris

About

Simple example of implementing a clip-detecting volume meter in Web Audio.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published