Package Exports
- @thi.ng/dsp-io-wav
- @thi.ng/dsp-io-wav/api
- @thi.ng/dsp-io-wav/write
Readme
[!IMPORTANT] ‼️ Announcing the thi.ng user survey 2024 📋
Please participate in the survey here!
(open until end of February)To achieve a better sample size, I'd highly appreciate if you could circulate the link to this survey in your own networks.
[!NOTE] This is one of 189 standalone projects, maintained as part of the @thi.ng/umbrella monorepo and anti-framework.
🚀 Help me to work full-time on these projects by sponsoring me on GitHub. Thank you! ❤️
About
WAV file format generation. This is a support package for @thi.ng/dsp.
Status
STABLE - used in production
Search or submit any issues for this package
Installation
yarn add @thi.ng/dsp-io-wavES 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
Dependencies
Usage examples
One project in this repo's /examples directory is using this package:
| Screenshot | Description | Live demo | Source |
|---|---|---|---|
![]() |
Generative audio synth offline renderer and WAV file export | Demo | Source |
API
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)
)
);Authors
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
}License
© 2020 - 2024 Karsten Schmidt // Apache License 2.0
