Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including audio-analyser with all npm packages installed. Try it out:

var audioAnalyser = require("audio-analyser")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

audio-analyser v1.0.2

Audio analyser stream

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


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,
    applyWindow: function (sampleNumber, totalSamples) {

    //...pcm-stream params, if required

//AnalyserNode methods

// Copies the current frequency data into a Float32Array array passed into it.

// Copies the current frequency data into a Uint8Array passed into it.

// Copies the current waveform, or time-domain data into a Float32Array array passed into it.

// Copies the current waveform, or time-domain data into a Uint8Array passed into it.

//Shortcut methods

//return array with frequency data in decibels of size <= fftSize

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

//Can be used both as a sink or pass-through


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.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free