1.0.2 • Published 5 years ago

the-wav v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

the-wav

Build Status npm Version JS Standard

Wav file writer

Installation

$ npm install the-wav --save

Usage

'use strict'

const { TheWAV } = require('the-wav')

async function tryExample () {
  const wav = new TheWAV(`sample01.wav`, {
    sampleRate: 48000,
  })

  const seconds = 10
  // Create white noise 10 sec
  const whiteNoise10sec = [
    new Float32Array(wav.sampleRate * seconds).map(() => Math.random() - 0.5),
    new Float32Array(wav.sampleRate * seconds).map(() => Math.random() - 0.5),
  ]

  // Append data
  await wav.append(whiteNoise10sec)
  await wav.append(whiteNoise10sec)

  // Write into file
  await wav.flush()
}

tryExample().catch((err) => console.error(err))

API Guide

License

This software is released under the MIT License.

Links

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago