Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,34 +405,6 @@ jobs:
working-directory: examples/ios-feedback
run: xcodebuild -scheme cpal-ios-example -configuration Debug -derivedDataPath build -sdk iphonesimulator -arch arm64

# WebAssembly - Emscripten
wasm-emscripten:
runs-on: ubuntu-latest
env:
TARGET: wasm32-unknown-emscripten
steps:
- uses: actions/checkout@v5

- name: Setup Emscripten toolchain
uses: mymindstorm/setup-emsdk@v14

- name: Install Rust MSRV (${{ env.MSRV_WASM }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV_WASM }}
targets: ${{ env.TARGET }}

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: wasm-emscripten

- name: Check examples (default features)
run: cargo +${{ env.MSRV_WASM }} check --examples --workspace --verbose --target ${{ env.TARGET }}

- name: Check examples (no default features)
run: cargo +${{ env.MSRV_WASM }} check --examples --no-default-features --workspace --verbose --target ${{ env.TARGET }}

# WebAssembly - wasm-bindgen
wasm-bindgen:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -574,7 +546,6 @@ jobs:
- macos
- android
- ios
- wasm-emscripten
- wasm-bindgen
- wasm-audioworklet
- wasm-wasip1
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ jobs:
features: ""
os: ubuntu-latest

# WASM - Emscripten
- target: wasm32-unknown-emscripten
name: WASM-emscripten
features: ""
os: ubuntu-latest

# WASM - wasm-bindgen feature
- target: wasm32-unknown-unknown
name: WASM-bindgen
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

- Replaced `StreamInstant::add()` and `sub()` by `checked_add()`/`+` and `checked_sub()`/`-`.
- **Emscripten**: Removed broken host; use the WebAudio host instead.

### Fixed

Expand All @@ -94,7 +95,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **ASIO**: Poisoned stream mutex in the buffer-size change handler no longer silently skips the
update.
- **CoreAudio**: Fix undefined behaviour and silent failure in loopback device creation.
- **Emscripten**: Fix build failure introduced by newer `wasm-bindgen` versions.
- **JACK**: Fix input capture timestamp using callback execution time instead of cycle start.
- **JACK**: Poisoned error callback mutex no longer silently drops subsequent error notifications.
- **JACK**: Port registration failure now fails stream creation instead of silently failing.
Expand Down
16 changes: 0 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,6 @@ objc2-avf-audio = { version = "0.3", default-features = false, features = [
"AVAudioSessionTypes",
] }

[target.'cfg(target_os = "emscripten")'.dependencies]
wasm-bindgen = { version = "0.2" }
wasm-bindgen-futures = "0.4"
js-sys = { version = "0.3" }
web-sys = { version = "0.3", features = [
"AudioContext",
"AudioContextOptions",
"AudioBuffer",
"AudioBufferSourceNode",
"AudioNode",
"AudioDestinationNode",
"Window",
"AudioContextState",
] }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
Expand Down Expand Up @@ -227,7 +212,6 @@ targets = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"wasm32-unknown-unknown",
"wasm32-unknown-emscripten",
"aarch64-linux-android",
"x86_64-unknown-freebsd",
"x86_64-unknown-netbsd",
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Currently, supported platforms include:

- Android (via AAudio)
- BSD (via ALSA by default, JACK, PipeWire or PulseAudio optionally)
- Emscripten
- iOS (via CoreAudio)
- Linux (via ALSA by default, JACK, PipeWire or PulseAudio optionally)
- macOS (via CoreAudio by default, JACK optionally)
Expand Down
25 changes: 25 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This guide covers breaking changes requiring code updates. See [CHANGELOG.md](CH
- [ ] Update `StreamInstant::new(secs, nanos)` call sites: `secs` is now `u64`.
- [ ] Update `StreamInstant::from_nanos(nanos)` call sites: `nanos` is now `u64`.
- [ ] Update `duration_since` call sites to pass by value (drop the `&`).
- [ ] Migrate `wasm32-unknown-emscripten` to `wasm32-unknown-unknown` if possible.

## 1. Error enums are now `#[non_exhaustive]`

Expand Down Expand Up @@ -134,6 +135,30 @@ StreamInstant::new(0_u64, 0);

**Why:** All audio host clocks are positive and monotonic; they are never negative.

## 5. `wasm32-unknown-emscripten` target removed

**What changed:** The `emscripten` audio host and the `wasm32-unknown-emscripten` build target are no longer supported.

Migrate to `wasm32-unknown-unknown` and enable the `wasm-bindgen` feature:

```toml
# Before (v0.17)
cpal = { version = "0.17", features = ["emscripten"] }

# After (v0.18)
cpal = { version = "0.18", features = ["wasm-bindgen"] }
```

Then select the `webaudio` host at runtime:

```rust
let host = cpal::host_from_id(cpal::HostId::WebAudio)?;
```

If you must target `wasm32-unknown-emscripten` specifically, consider using OpenAL or another audio approach that supports that target, as cpal no longer provides audio on Emscripten.

**Why:** The old `emscripten` host relied on deprecated Emscripten audio APIs that are no longer functional.

---

# Upgrading from v0.16 to v0.17
Expand Down
Loading
Loading