Releases: rochars/wavefile
v11.0.0
v10.4.3
v10.4.2
v10.4.1
v10.4.0
version 10.4.0 - 2020-01-20
- Default LPF for resample is IIR
- Use FIR or IIR LPFs to resample:
// Will use 'linear' method with a FIR LPF
wav.toSampleRate(44100, {method: "linear", LPF: true, LPFType: 'FIR'});
// Will use 'linear' method with a IIR LPF, the default
wav.toSampleRate(44100, {method: "linear", LPF: true});
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);
v10.2.0
version 10.2.0 - 2020-01-16
Change the sample rate.
New Features:
Change the sample rate with wav.toSampleRate();
Fixes:
- Bug that prevented creating multi channel files using a array of typed arrays for samples
- Type declaration for sample arrays now use more generic types to ease integration
v10.1.0
Add getSamples() to the API. It returns the samples packed in a Float64Array.
If the file have more than one channel, samples will be returned de-interleaved
in a Array of Float64Array objects, one for each channel. The method takes a
optional boolean param interleaved, set to false by default. If set to
true, samples will be returned interleaved. Default is de-interleaved.
// Both will return de-interleaved samples
samples = wav.getSamples();
samples = wav.getSamples(false);
// To get interleaved samples
samples = wav.getSamples(true);
v10.0.0
version 10.0.0 - 2020-01-07
Better handling of cue points and regions.
API Changes:
- listCuePoints() now returns a list of objects with more information about each cue point:
[
{
position: 500, // the position in milliseconds
label: 'cue marker 1',
end: 1500, // the end position in milliseconds
dwName: 1,
dwPosition: 0,
fccChunk: 'data',
dwChunkStart: 0,
dwBlockStart: 0,
dwSampleOffset: 22050, // the position as a sample offset
dwSampleLength: 3646827, // the region length as a sample count
dwPurposeID: 544106354,
dwCountry: 0,
dwLanguage: 0,
dwDialect: 0,
dwCodePage: 0,
},
//...
];
- setCuePoint() param is now a object with the cue point data:
// to create a cue point the position in milliseconds
// is the only required attribute
wav.setCuePoint({position: 1500});
// to create a cue point with a label
wav.setCuePoint({position: 1500, label: 'some label'});
// to create a cue region with a label:
wav.setCuePoint({position: 1500, end: 2500, label: 'some label'});
Objects that define regions can also define the following optional properties:
- dwPurposeID
- dwCountry
- dwLanguage
- dwDialect
- dwCodePage
New Features:
- setCuePoint() now can create both cue points and regions.
Fixes:
- Fix setCuePoint() bug that caused some labels to display the wrong text