Class: WavUtils

WavUtils()

Class with some static utility functions for working with WAV-data

Constructor

new WavUtils()

Methods

(static) getAudioInfo(fileData) → {AudioInfo}

Returns WAV file audio info
Parameters:
Name Type Description
fileData Uint8Array Array containing complete WAV file contents
Returns:
Object containing audio info
Type
AudioInfo

(static) readAsFloatSamples(fileData) → {Float32Array}

Reads WAV file from a memory buffer as a float samples buffer (WAV file can be of any format)
Parameters:
Name Type Description
fileData Uint8Array Array containing complete WAV file contents
Returns:
Array of float samples
Type
Float32Array

(static) readAsFloatSamples16Bit(fileData) → {Float32Array}

Reads WAV file from a memory buffer as a float samples buffer with 16-bit precision (WAV file can be of any format)
Parameters:
Name Type Description
fileData Uint8Array Array containing complete WAV file contents
Returns:
Array of float samples with 16-bit precision
Type
Float32Array

(static) readAsPcm16Bytes(fileData) → {Uint8Array}

Reads WAV file from a memory buffer as a PCM16 bytes buffer
Parameters:
Name Type Description
fileData Uint8Array Array containing complete WAV file contents
Returns:
Array of bytes, containing little-endian PCM16 samples
Type
Uint8Array

(static) readAsPcm16Samples(fileData) → {Int16Array}

Reads WAV file from a memory buffer as a PCM16 samples buffer (WAV file can be of any format)
Parameters:
Name Type Description
fileData Uint8Array Array containing complete WAV file contents
Returns:
Array of PCM16 samples
Type
Int16Array