Package Exports
- node-web-audio-api
- node-web-audio-api/index.js
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 (node-web-audio-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-web-audio-api
Nodejs bindings for
orottier/web-audio-api-rsusingnapi-rs
Install
npm install [--save] node-web-audio-apiExample
import { AudioContext, OscillatorNode, GainNode } from 'node-web-audio-api';
const audioContext = new AudioContext();
setInterval(() => {
const now = audioContext.currentTime;
const env = new GainNode(audioContext);
env.connect(audioContext.destination);
env.gain.value = 0;
env.gain.setValueAtTime(0, now);
env.gain.linearRampToValueAtTime(1, now + 0.02);
env.gain.exponentialRampToValueAtTime(0.0001, now + 1);
const osc = new OscillatorNode(audioContext);
osc.frequency.value = 200 + Math.random() * 2800;
osc.connect(env);
osc.start(now);
osc.stop(now + 1);
}, 50);Build manually
If prebuilt binaries are not shippped for your platform, you will need to install the rust toolchain and install and build the package from github.
- Install rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- Install from github
npm install --save git+https://github.com/b-ma/node-web-audio-api.gitNote that the package will be built on your machine, so the install process might be a bit long
Roadmap
- Make a few nodes work properly with clean and predictable code
- Generate bindings from IDL https://webaudio.github.io/web-audio-api/#idl-index
- Publish on
npmwith binaries - Implement prototype chain (?)
- Follow developments of
web-audio-api-rs
License
This project is licensed under the BSD-3-Clause license.