Socket
Socket
Sign inDemoInstall

wavefile

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wavefile - npm Package Versions

23
15

11.0.0

Diff

Changelog

Source

version 11.0.0 - 2020-01-30

API changes

  • clamp int samples on overflow instead of throwing RangeError

Other changes

  • Zero dependencies
rochars
published 10.4.3 •

Changelog

Source

version 10.4.3 - 2020-01-27

  • Fix: large files RIFF/RIFX conversion
rochars
published 10.4.2 •

Changelog

Source

version 10.4.2 - 2020-01-22

Better sinc resampling.

rochars
published 10.4.1 •

Changelog

Source

version 10.4.1 - 2020-01-21

Faster sinc resampling.

rochars
published 10.4.0 •

Changelog

Source

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});
rochars
published 10.3.0 •

Changelog

Source

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);
rochars
published 10.2.0 •

Changelog

Source

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
rochars
published 10.1.0 •

Changelog

Source

version 10.1.0 - 2020-01-08

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);
rochars
published 10.0.0 •

Changelog

Source

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
rochars
published 9.1.1 •

Changelog

Source

version 9.1.1 - 2020-01-04

  • Smaller dist file
23
15
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc