Node Web Audio API provides a robust and specification-compliant implementation of the W3C Web Audio API for Node.js environments. Currently at version 1.0.9, it leverages a performant Rust backend (`web-audio-api-rs`) and `napi-rs` bindings to offer core audio processing capabilities, including `AudioContext`, `OscillatorNode`, and `GainNode`, suitable for server-side audio generation and manipulation. While a strict release cadence isn't published, updates align with improvements in its underlying Rust components. Key differentiators include its high performance and strict adherence to the Web Audio API specification, which is crucial for developers porting browser-based audio applications or building new audio services in Node.js. An accompanying `isomorphic-web-audio-api` package is available for cross-platform development.
npm install node-web-audio-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes an AudioContext and creates an oscillating sound with a random frequency and a decaying envelope every 80 milliseconds for a duration of 10 seconds.
Rewrite code to utilize `AudioBuffer#copyToChannel(source, channelNumber)` or `AudioBuffer#copyFromChannel(destination, channelNumber)` instead of `getChannelData()`.
Avoid relying on advanced MediaStream functionalities. For complex streaming scenarios, consider alternative Node.js audio processing libraries or external services.
Initialize the `AudioContext` with `{ sinkId: { type: 'none' } }` to explicitly declare it as headless or without an audio output, e.g., `new AudioContext({ sinkId: { type: 'none' } })`.Ensure JACK or PipeWire with JACK compatibility is installed and configured on your Linux system. If issues persist, consider building from source after installing the Rust toolchain.
Install the Rust toolchain using `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` and then run `npm install` within the package directory or your project.
Initialize the audio context with `new AudioContext({ sinkId: { type: 'none' } })` to indicate it should run without an audio output device.First, ensure `npm install` ran successfully. If the error persists, you may need to compile the package from source. Install the Rust toolchain (`rustup install stable`) and then navigate to the package's `node_modules` directory (`cd node_modules/node-web-audio-api`) and run `npm run build`.
On Debian/Ubuntu, install `build-essential` via `sudo apt-get install build-essential`. On macOS, install Xcode Command Line Tools via `xcode-select --install`. Ensure your Rust toolchain is also up-to-date (`rustup update`).
No dependency data recorded yet.