
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
webaudio-peaks
Advanced tools
Small library to extract peaks from an array of audio samples or an AudioBuffer from the WebAudio API.
Small library to extract peaks from an array of audio samples or a webaudio AudioBuffer.
npm install webaudio-peaks --save
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);
});
function to extract peaks from a TypedArray, or AudioBuffer
Params
TypedArray|AudioBuffer
- A source of audio samples.number
- Number of samples used to calculate a single peak.boolean
- Combine all channels into one array of peaks or not.number
- Sample to begin at. The offset is inclusive.number
- Sample to end at. The offset is exclusive.(8|16|32)
- Resolution of calculated peaks.Returns: object
{
length: `number`; //Number of calculated peaks,
//Computed peak data, length == #channels or 1 if isMono == true
//Each entry of type `Int{bits}Array`
data: `Array`;
bits: `(8|16|32)`; //Resolution of calculated peaks.
}
FAQs
Small library to extract peaks from an array of audio samples or an AudioBuffer from the WebAudio API.
The npm package webaudio-peaks receives a total of 411 weekly downloads. As such, webaudio-peaks popularity was classified as not popular.
We found that webaudio-peaks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.