Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

audio-analyser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-analyser

Audio analyser stream

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Audio analyser stream. Provides API of the AnalyserNode for audio-streams. In all respects can be used in the same way.

Usage

npm install audio-analyser

var Analyser = require('audio-analyser');
var Generator = require('audio-generator');


var analyser = new Analyser({
	// Magnitude diapasone, in dB
	minDecibels: -100,
	maxDecibels: -30,

	// Number of time samples to transform to frequency
	fftSize: 1024,

	// Number of frequencies, twice less than fftSize
	frequencyBinCount: 1024/2,

	// Smoothing, or the priority of the old data over the new data
	smoothingTimeConstant: 0.2,

	// Number of channel to analyse
	channel: 0,

	// Size of time data to buffer
	bufferSize: 44100,

	// Windowing function for fft, https://github.com/scijs/window-functions
	applyWindow: function (sampleNumber, totalSamples) {
	}

	//...pcm-stream params, if required
});


//AnalyserNode methods

// Copies the current frequency data into a Float32Array array passed into it.
analyser.getFloatFrequencyData(arr);

// Copies the current frequency data into a Uint8Array passed into it.
analyser.getByteFrequencyData(arr);

// Copies the current waveform, or time-domain data into a Float32Array array passed into it.
analyser.getFloatTimeDomainData(arr);

// Copies the current waveform, or time-domain data into a Uint8Array passed into it.
analyser.getByteTimeDomainData(arr);


//Shortcut methods

//return array with frequency data in decibels of size <= fftSize
analyser.getFrequencyData(size);

//return array with time data of size <= self.bufferSize (way more than fftSize)
analyser.getTimeData(size);


//Can be used both as a sink or pass-through
Generator().pipe(analyser);

audio-render — render audio streams.
audio-spectrum — render audio spectrum.
audio-spectrogram — render audio spectrogram.
audio-waveform — render audio waveform.
audio-stat — render any kind of audio info: waveform, spectrogram etc.
pcm-util — utils for work with pcm-streams.
ndarray-fft — implementation of fft for ndarrays.

Keywords

analysernode

FAQs

Package last updated on 07 Nov 2015

Did you know?

Socket

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.

Install

Related posts