1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! [](https://crates.io/crates/firewheel-web-audio)
//! [](https://docs.rs/firewheel-web-audio)
//!
//! A multi-threaded `wasm32-unknown-unknown` Web Audio
//! backend for [Firewheel](https://github.com/BillyDM/firewheel).
//!
//! Currently, this backend only supports stereo inputs and outputs.
//!
//! ## Requirements
//!
//! Because this crate relies on Wasm multi-threading, it has
//! some additional requirements.
//!
//! 1. A nightly compiler is required along with the Rust standard library source code
//! (with `rustup`, you can add it with `rustup component add rust-src`).
//! 2. You'll need the `atomics`, `bulk-memory`, and `mutable-globals` target features.
//! These can be enabled with a `.cargo/config.toml`:
//!
//! ```toml
//! [target.wasm32-unknown-unknown]
//! rustflags = ["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals"]
//!
//! [unstable]
//! build-std = ["std", "core", "alloc", "panic_abort"]
//! ```
//! 3. Wherever your project is served, the protocol must be secure (usually `https`)
//! and the response must include two security headers:
//!
//! ```text
//! 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.
pub use ;
const BLOCK_FRAMES: usize = 128;