Create audio stream from AudioBuffer or ArrayBuffer.
Usage
As a function
Audio-source in functional style is a sync source.
const createSource = ;const createSpeaker = ;const lena = ; let read = ;let write = ; //create and start reading loop { //get next chunk buf = ; //catch end if !buf return; //send chunk to speaker ;};
As a pull-stream
Pull-streams are awesome and faster than streams (but slower than plain fn).
const pull = ;const Source = ;const Speaker = ;const lena = ; let source = ;let sink = ; ;
As a stream
Streams are concise:
const Source = ;const Speaker = ;const lena = ; ;
API
const Source = ; //create source readerlet read =
Related
web-audio-stream — connect WebAudio to audio-stream or audio-stream to WebAudio.