- clamp int samples on overflow instead of throwing RangeError
- Zero dependencies
- Fix: large files RIFF/RIFX conversion
Better sinc resampling.
Faster sinc resampling.
- 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});
-
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);
Change the sample rate.
Change the sample rate with wav.toSampleRate();
- 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
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);
Better handling of cue points and regions.
- 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
- setCuePoint() now can create both cue points and regions.
- Fix setCuePoint() bug that caused some labels to display the wrong text
- Smaller dist file
- Read and write iXML chunks
- Read and write _PMX chunks To change the value of iXML of _PMX chunks:
wav.setiXML(iXMLValue);
wav.set_PMX(_PMXValue);
Fix: chunkSize of LIST subChunks that have string values
- Fix: remove extra field from ltxt chunks to fix wav regions labels
- Fix: add padding byte on bext when byte number is odd to avoid writing currupted files
- Update byte-data@18 for performance improvement
- New package structure:
- dist file is "./dist/wavefile.js", a UMD served as "main"
- ES6 source is "./index.js", served as "module"
- WaveFile class is no longer a default export. You should use like this:
- Node.js:
const WaveFile = require('uint-buffer').WaveFile;
- Browser:
<script src="wavefile.js"></script>
<script>
var WaveFile = wavefile.WaveFile;
var wav = new WaveFile();
</script>
- Fix: clicks and time changes in ADPCM compression/decompression
- Fix: Range error bug when converting some files to ADPCM
- Fix: The length of the output array when converting to ADPCM
- Fix: properly reset chunks in WaveFile objects when using the same object to read multiple files or performing conversions.
- Fix: keep metadata when performing bit depth conversions or applying compression
- Fix: read UTF8 chars in cue points (#13)
- Fix: browser directive in package.json
- Fix: Stop adding a extra sample when changing the bit depth
- Fix: Add padding byte if sample buffer lenght is odd
- Use ArrayBufferView to represent TypedArray in index.d.ts
- Use WaveFile.prototype in externs/wavefile.js
- Update dependencies.
- Compatible with IE10+
- Fix misssing properties in TypeScript declaration file.
- Fix documentation issues.
- Add external dependencies.
- Add getSample(index) to the API; return the sample at a given index.
- Add setSample(index, sample) to the API; set the sample at a given index.
- Add listTags() method to the API. It return a Object<tag, value> with the RIFF tags in the file.
- Add listCuePoints() method to the API. It return a object similar to in WaveFile.cue, but with the position of each point in milliseconds.
- Fix: Remove unecessary files from the dist.
- Update documentation.
- No dependencies.
- Fix: UMD dist transpiled to ES5.
- Use updated alawmulaw module to avoid license issues
- Fix: update bext.chunkSize on object after toBuffer() is called.
- Fix documentation issues.
- Add CLI to manipulate wave files from the command line.
- Fix: Change the bit depth and apply compression to huge files.
- Fix: Handle multiple instances of RIFX and RIFF.
- Remove @export tags
- Add externs file for the Closure Compiler
- Update TypeScript declaration with fromBuffer() optional argument
- Read and write huge files.
- Fix: CommonJS dist to be compatible with TypeScript declaration file.
- Remove interleave() and deInterleave() from the API.
- Add TypeScript declaration file.
- ES6 module.
- Better memory use.
- Smaller dist files.
- feature: Add BWF data to files.
- update: byte-data to version 9 and riff-chunks to version 5.
- fix: remove dist from npm in v6 to avoid breaking dependents.
- fix: webpack.config so no dependency dist is used in the bundle.
- browser version on npm.
- Removed /dist from .npmignore.
- Add 'browser' to package.json.
- Update riff-chunks to 4.0.6 to fix odd numbers on chunkSize.
- Add support for 'ltxt' chunks.
- Reading and writing the "smpl" chunk.
- fix: listChunks var JSDoc type definition in readLISTChunk_().
- Better documentation.
- fix: dwChannelMask for 1, 2, 4, 6 and 8 channels.
- Better implementation of interleave() and deInterleave() methods.
- fix: JSDoc tags and documentation.
- fromBase64() and fromDataURI() added to the API to load WaveFile objects from base64 strings and DataURIs.
- Update labels with updateLabel(labelIndex, labelText)
- Reading and writing the "adtl" LIST subchunk. Labels ("labl") can be created with cue points using setCuePoint(timeInMs, labelText)
- Set and delete cue points with setCuePoint() and deleteCuePoint().
- Set, get and delete tags on files with setTag(), getTag() and deleteTag().
- Safer estimation of chunkSizes.
- Fix: data.chunkSize calculated when writing the file.
- Reading and writing tags from "LIST" chunks of type "INFO".
- Reading and writing cue points.
- BWF data is kept when changing bit depth, using compression or when re-creating an existing WaveFile object with the fromScratch() or fromBuffer() method.
- Reading the "junk" chunk. The chunk is kept when changing bit depth, using compression or when re-creating an existing WaveFile object with the fromScratch() or fromBuffer() method.
- Fix: all chunkSize fields are calculated when writing the file.
- Fix: calling clearHeader_() on fromBuffer(), not just fromScratch(). The method is used to clear data in the file header that might lead to corrupt files, like the "fact" chunk.
- Fix: assure samples are de-interleaved on fromScratch() before using the array.
- Using compilationLevel: ADVANCED with Closure Compiler.
- WaveFile.toBase64() and WaveFile.toDataURI() to export the file as a Base64 string or a DataURI.
- fromIMAADPCM, fromALaw and fromMuLaw can receive an optional parameter: the bit depth of the output. If ommited, defaults to "16".
- Fix: argument validation in fromScratch
- Limited support of RF64. Need to be tested with files > 4gb in size.
- Using byte-data^7.0.0 and riff-chunks^4.0.1.
- Reading and writing the data in the "cue " chunk.
- New API. Methods have the same name, but properties have changed.
- The samples are now under WaveFile.data.samples, not WaveFile.samples.
- "fmt " data is now an object under WaveFile.fmt
- "data" data is now under WaveFile.data
- "fact" data is now under WaveFile.fact
- "bext" data is now under WaveFile.bext
- Support for direct conversion of any bith depth to any compression type.
- Samples are automatically interleaved when reading/writing files