Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-wav

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-wav

High performance WAV file decoder and encoder

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
179K
decreased by-5.35%
Maintainers
1
Weekly downloads
 
Created
Source

node-wav

High performance WAV decoder and encoder. The decoder is up to 750x faster than the 'wav-decoder' npm module.

In addition, in contrast to 'wav-decoder' the result is returned directly instead of with a promise.

This module combines the functionality of 'wav-decoder' and 'wav-encoder'.

Usage

let fs = require('fs');
let wav = require('node-wav');

let buffer = fs.readFileSync('file.wav');
let result = wav.decode(buffer);
console.log(result.sampleRate);
console.log(result.channelData); // array of Float32Arrays

wav.encode(result.channelData, { sampleRate: result.sampleRate, float: true, bitDepth: 32 });

Data format

Data is always returned as Float32Arrays. While reading and writing 64-bit float WAV files is supported, data is truncated to 32-bit floats.

Endianness

This module assumes a little endian CPU, which is true for pretty much every processor these days (in particular Intel and ARM).

Keywords

FAQs

Package last updated on 16 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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