triolet.bundle

1.1.0 • Public • Published

triolet.bundle

NPM Version License

All components in the main thread. This architecture works on the browser and the Node.js

triolet.bundle

Installation

$ npm install triolet.bundle

Example

in the main thread

const triolet = require("triolet.bundle")();
const Driver = require("pico.driver.webaudio");
const API = require("./api");
const DSP = require("./dsp");

let audioContext = new AudioContext();

triolet.compose({ api: new API(), dsp: new DSP(), driver: new Driver() });
triolet.setup({ context: audioContext, bufferLength: 1024 });

triolet.start();

API

Triolet

  • constructor()

Instance attributes

  • api: TrioletAPI
  • dsp: TrioletDSP
  • driver: pico.driver
  • sampleRate: number (implicit readonly)
  • bufferLength: number (implicit readonly)
  • state: string (implicit readonly)

Instance methods

  • compose(spec: object): self
  • setup(opts: object): self
  • start(): self
  • stop(): self
  • sendToAPI(data: any): void
  • sendToDSP(data: any): void

Interfaces

interface TrioletAPI {
  optional setup(opts: object) => void;
  optional start() => void;
  optional stop() => void;
  process(inNumSamples: number) => void;
}
interface TrioletDSP {
  optional setup(opts: object) => void;
  optional start() => void;
  optional stop() => void;
  process(bufL: Float32Array, bufR: Float32Array) => void;
}

Audio Drivers

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i triolet.bundle

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • mohayonao