Skip to content

soundio/soundstage

Repository files navigation

Soundstage

Soundstage is an object model for WebAudio processing. It provides an API for creating, manipulating and observing audio graphs, event pipes and sequencing for event recording and playback, and a JSONify-able structure for import and export of sound designs.

Setup

Note Soundstage includes a number of workers and audio worklets, and uses SharedArrayBuffers. The document must be served with Cross Origin Isolation and the workers with Cross Origin Embedder Policy.

Install Rustup (Rust toolchain manager) and wasm-pack (for WebAssembly compilation):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install wasm-pack

Compile rust to WASM:

make rust

The build process requires Deno to be installed. Build modules to build/:

make modules

Use Soundstage

Import Soundstage:

<script type="module">
    import Soundstage from './soundstage/build/stage.js'

    const stage = await Stage.load({
        nodes: [
            { id: 1, type: 'audio-in' },
            { id: 2, type: 'delay', data: { delayTime: 0.6 } },
            { id: 3, type: 'audio-out' },
        ],

        connections: [
            1, 0, 2, 0,
            2, 0, 3, 0
        ]
    });
</script>

About

A graph object model and sequencing engine for the Web Audio API

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •