This project is part of the @thi.ng/umbrella monorepo and anti-framework.
WAV file format generation. This is a support package for @thi.ng/dsp.
STABLE - used in production
Search or submit any issues for this package
yarn add @thi.ng/dsp-io-wav
ES module import:
<script type="module" src="https://cdn.skypack.dev/@thi.ng/dsp-io-wav"></script>
For Node.js REPL:
const dspIoWav = await import("@thi.ng/dsp-io-wav");
Package sizes (brotli'd, pre-treeshake): ESM: 488 bytes
Several demos in this repo's /examples directory are using this package.
A selection:
Screenshot | Description | Live demo | Source |
---|---|---|---|
Generative audio synth offline renderer and WAV file export | Demo | Source |
TODO
import { osc, sin } from "@thi.ng/dsp";
import { wavByteArray } from "@thi.ng/dsp-io-wav";
const FS = 48000;
// write 1 second 24bit mono WAV file of 440Hz sine
fs.writeFileSync(
"sine-440.wav",
wavByteArray(
{ sampleRate: FS, channels: 1, length: FS, bits: 24 },
osc(sin, 440 / FS)
)
);
If this project contributes to an academic publication, please cite it as:
@misc{thing-dsp-io-wav,
title = "@thi.ng/dsp-io-wav",
author = "Karsten Schmidt",
note = "https://thi.ng/dsp-io-wav",
year = 2020
}
© 2020 - 2023 Karsten Schmidt // Apache License 2.0