audio-stream-meter
Simple meter for showing audio stream volume.
Installation
$ npm install audio-stream-meter
Quick start
var AudioStreamMeter = require; navigator.mediaDevices.getUserMedia.then
Configuration
var config = ; var meter = AudioStreamMeter.audioStreamProcessor
- bufferSize - more value create higher latency of audio sample-frames,
- inputChannels - how many input channels should be handling, passing more channels then exists in stream will flatten volume,
- volumeFall - more means volume wave will be fall slower.
- throttle - sets step for which will be take samples for calculations, see percent of calculated samples by means of formula f(x) = 1 / x * 100,
Controls
- callbackFn() - function is invoke after each processing audio samples and can use within data from 'Output data' paragraph. For example: callbackFn(){ console.log(meter.volume)}
- meter.close() - close and disconnect audio processing
Output data
- meter.volume - gives info about volume of the last package of samples - intervals [0, 1],
Licence
MIT