v10.3.0
version 10.3.0 - 2020-01-20
Features
-
New resample methods: linear for linear interpolation and point for nearest point interpolation. Both methods use no LPF by default; others methods use LPF by default.
-
Resample with or without LPF using any interpolation method:
// Resample using cubic without LPF
wav.toSampleRate(44100, {method: 'cubic', LPF: false});
// Resample using cubic with LPF:
wav.toSampleRate(44100, {method: 'cubic', LPF: true});
// cubic and sinc use LPF by default
wav.toSampleRate(44100, {method: 'cubic'}); // will use LPF
- You can now use any Typed Array as the output for
getSamples()
:
// Will return the samples de-interleaved,
// packed in a array of Int32Array objects, one for each channel
samples = wav.getSamples(false, Int32Array);
// will return the samples de-interleaved,
// packed in a array of Int16Array objects, one for each channel
let samples = getSamples(false, Int16Array);
// will return the samples interleaved, packed in a Int16Array
let samples = getSamples(true, Int16Array);