utils/audio

Helper module for audio processing.

These functions and classes are only used internally, meaning an end-user shouldn’t need to access anything here.


utils/audio.read_audio(url, sampling_rate)Promise.<Float32Array>

Helper function to read audio from a path/URL.

Kind: static method of utils/audio
Returns: Promise.<Float32Array> - The decoded audio as a Float32Array.

ParamTypeDescription
urlstring | URL

The path/URL to load the audio from.

sampling_ratenumber

The sampling rate to use when decoding the audio.


utils/audio.getMelFilters(sr, n_fft, n_mels)Array.<Array<number>>

Creates a frequency bin conversion matrix used to obtain a mel spectrogram.

Kind: static method of utils/audio
Returns: Array.<Array<number>> - Projection matrix to go from a spectrogram to a mel spectrogram.

ParamTypeDescription
srnumber

Sample rate of the audio waveform.

n_fftnumber

Number of frequencies used to compute the spectrogram (should be the same as in stft).

n_melsnumber

Number of mel filters to generate.