duolet.audioworker
This is an experimental module. AudioWorker haven't been implemented in any browsers yet. *
DRIVER
and DSP
in the worker thread. This architecture works on the browser.
Installation
$ npm install duolet.audioworker
Example
in the main thread
const duolet = ;const Driver = ; let audioContext = ; duolet;duolet; duolet;
in the worker thread
const duolet = self;const Driver = ;const DSP = ; duolet; duolet { if etype === "start" duoletstart; };
API
client/Duolet
constructor()
Instance attributes
driver: pico.driver
sampleRate: number
(implicit readonly)bufferLength: number
(implicit readonly)
Instance methods
compose(spec: object): self
setup(opts: object): self
start(): self
stop(): self
sendToServer(data: any): void
worker/Duolet
constructor(self: AudioWorkerGlobalScope)
Instance attributes
dsp: duoletDSP
sampleRate: number
(implicit readonly)bufferLength: number
(implicit readonly)
Instance methods
compose(spec: object): self
setup(opts: object): self
start(): self
stop(): self
sendToClient(data: any): void
Interfaces
interface duoletDSP {
optional setup(opts: object) => void;
optional start() => void;
optional stop() => void;
process(bufL: Float32Array, bufR: Float32Array) => void;
}
Audio Drivers
License
MIT