Expand description
A multi-threaded wasm32-unknown-unknown
Web Audio
backend for Firewheel.
Currently, this backend only supports stereo inputs and outputs.
§Requirements
Because this crate relies on Wasm multi-threading, it has some additional requirements.
- A nightly compiler is required along with the Rust standard library source code
(with
rustup
, you can add it withrustup component add rust-src
). - You’ll need the
atomics
,bulk-memory
, andmutable-globals
target features. These can be enabled with a.cargo/config.toml
:
[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals"]
[unstable]
build-std = ["std", "core", "alloc", "panic_abort"]
- Wherever your project is served, the protocol must be secure (usually
https
) and the response must include two security headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
# or
Cross-Origin-Embedder-Policy: credentialless
Note that credentialless
may not work on Safari: the browser
may throw an error in the audio worklet upon receiving shared Wasm memory.
Structs§
- WebAudio
Backend - The main-thread host for the Web Audio API backend.
- WebAudio
Config - The Web Audio backend’s configuration.
Enums§
- WebAudio
Start Error - Errors related to initializing the web audio stream.
- WebAudio
Stream Error - Errors encountered while the web audio stream is running.