WebRTC samples Audio stream volume

Measure the volume of a local media stream using WebAudio.

Instant:
Slow:
Clip:

The 'instant' volume changes approximately every 50ms; the 'slow' volume approximates the average volume over about a second.

Note that you will not hear your own voice; use the local audio rendering demo for that.

The audioContext, stream and soundMeter variables are in global scope, so you can inspect them from the console.

View source on GitHub