# node-wav

> High performance WAV file decoder and encoder

Latest version **0.0.2** (published 2016-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-wav
pnpm add node-wav
yarn add node-wav
bun add node-wav
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-08-25 |
| First published | 2016-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/node-wav) |
| Module format | CommonJS |
| Node | >=4.4.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 60 |
| Author | Andreas Gal |
| Maintainers | andreasgal |
| Keywords | wav, decode |

## Links

- npm: https://www.npmjs.com/package/node-wav
- Repository: https://github.com/andreasgal/node-wav
- Issues: https://github.com/andreasgal/node-wav/issues
- npm.io page: https://npm.io/package/node-wav

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-08-25
- 0.0.1 — 2016-07-16

## README

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).

---
_Source: https://npm.io/package/node-wav · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
