All components in the main thread. This architecture works on the browser and the Node.js
$ npm install duolet.bundle
in the main thread
const duolet = require("duolet.bundle")();
const Driver = require("pico.driver.webaudio");
const DSP = require("./dsp");
let audioContext = new AudioContext();
duolet.compose({ dsp: new DSP(), driver: new Driver() });
duolet.setup({ context: audioContext, bufferLength: 1024 });
duolet.start();
constructor()
dsp: duoletDSP
driver: pico.driver
-
sampleRate: number
(implicit readonly) -
bufferLength: number
(implicit readonly)
compose(spec: object): self
setup(opts: object): self
start(): self
stop(): self
sendToServer(data: any): void
interface duoletDSP {
optional setup(opts: object) => void;
optional start() => void;
optional stop() => void;
process(bufL: Float32Array, bufR: Float32Array) => void;
}
MIT