Small library to extract peaks from an array of audio samples or an AudioBuffer from the WebAudio API.
npm install webaudio-peaksSmall library to extract peaks from an array of audio samples or a webaudio AudioBuffer.

npm install webaudio-peaks --save
``javascript
var extractPeaks = require("webaudio-peaks");
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
//decode an ArrayBuffer into an AudioBuffer
audioCtx.decodeAudioData(audioData, function (decodedData) {
//calculate peaks from an AudioBuffer
var peaks = extractPeaks(decodedData, 10000, true);
});
`
Params
- source TypedArray|AudioBuffer - A source of audio samples.number
- samplesPerPixel - Number of samples used to calculate a single peak.boolean
- isMono - Combine all channels into one array of peaks or not.number
- cueIn - Sample to begin at. The offset is inclusive.number
- cueOut - Sample to end at. The offset is exclusive.(8|16|32)
- bits - Resolution of calculated peaks.
Returns: object
`javascriptnumber
{
length: ; //Number of calculated peaks,Int{bits}Array
//Computed peak data, length == #channels or 1 if isMono == true
//Each entry of type Array
data: ;(8|16|32)
bits: ; //Resolution of calculated peaks.``
}