Package Exports
- @thi.ng/dsp-io-wav
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@thi.ng/dsp-io-wav) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
This project is part of the @thi.ng/umbrella monorepo.
About
WAV file format generation. This is a support package for @thi.ng/dsp.
Status
ALPHA - bleeding edge / work-in-progress
Installation
yarn add @thi.ng/dsp-io-wav// ES module
<script type="module" src="https://unpkg.com/@thi.ng/dsp-io-wav?module" crossorigin></script>
// UMD
<script src="https://unpkg.com/@thi.ng/dsp-io-wav/lib/index.umd.js" crossorigin></script>Package sizes (gzipped, pre-treeshake): ESM: 498 bytes / CJS: 559 bytes / UMD: 642 bytes
Dependencies
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
Karsten Schmidt
License
© 2020 Karsten Schmidt // Apache Software License 2.0