Skip to main content

songbird-wasm

WebAssembly bridge that exposes the Rust audio engine to the browser via wasm-bindgen and cpal’s AudioWorklet backend.

What it owns

  • The WasmEngine entry point exposed to JavaScript.
  • Real-time audio output on a dedicated AudioWorklet thread.
  • Command/event ring-buffer marshalling between the JS main thread and the audio thread.

Public API

  • WasmEngine — main struct, constructed from JS; methods for playback control, position queries, and command/event ring-buffer I/O.

How it fits

Standalone WASM target. No workspace crates depend on it; it is the browser-side counterpart to songbird-app (Tauri) and songbird-headless (WebSocket). Depends on songbird-engine, songbird-plugins, songbird-clips, cpal (audioworklet feature), wasm-bindgen.

Tests

cargo test -p songbird-wasm (note: WASM-target tests require a wasm runner; most logic is exercised through songbird-engine).