Skip to content

Commit 44d6a76

Browse files
authored
fix:(audioworklet): bug when Wasm memory resizes and avoid JS allocations (#1050)
1 parent 543277d commit 44d6a76

File tree

18 files changed

+75
-56
lines changed

18 files changed

+75
-56
lines changed

.github/workflows/platforms.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ jobs:
264264
build-wasm-beep: true
265265

266266
- target: wasm32-unknown-unknown
267-
args: --features=web_audio_worklet
267+
args: --features=audioworklet
268268
build-worklet-beep: true
269269
rustflags: -C target-feature=+atomics,+bulk-memory,+mutable-globals
270270

@@ -306,9 +306,9 @@ jobs:
306306
working-directory: ./examples/wasm-beep
307307
run: cargo build --target ${{ matrix.target }}
308308

309-
- name: Build web-audio-worklet-beep example
309+
- name: Build audioworklet-beep example
310310
if: matrix.build-worklet-beep
311-
working-directory: ./examples/web-audio-worklet-beep
311+
working-directory: ./examples/audioworklet-beep
312312
env:
313313
RUSTFLAGS: ${{ matrix.rustflags }}
314314
run: cargo +nightly build --target ${{ matrix.target }} -Z build-std=std,panic_abort

.github/workflows/quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
with:
142142
key: clippy-wasm32-worklet
143143

144-
- name: Run clippy (web_audio_worklet)
144+
- name: Run clippy (audioworklet)
145145
env:
146146
RUSTFLAGS: -C target-feature=+atomics,+bulk-memory,+mutable-globals
147-
run: cargo +nightly clippy --all --target wasm32-unknown-unknown --features web_audio_worklet -Z build-std=std,panic_abort -- -D warnings
147+
run: cargo +nightly clippy --all --target wasm32-unknown-unknown --features audioworklet -Z build-std=std,panic_abort -- -D warnings

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
recorded.wav
66
rls*.log
77
/.direnv
8-
!/examples/web-audio-worklet-beep/.cargo/
8+
!/examples/audioworklet-beep/.cargo/
99

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ asio = [
1616
] # Only available on Windows. See README for setup instructions.
1717

1818
# Only available on web when atomics are enabled. See README for what it does.
19-
web_audio_worklet = [
19+
audioworklet = [
2020
"dep:wasm-bindgen-futures",
2121
"web-sys/Blob",
2222
"web-sys/BlobPropertyBag",

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Some audio backends are optional and will only be compiled with a [feature flag]
3737

3838
- JACK (on Linux): `jack`
3939
- ASIO (on Windows): `asio`
40-
- AudioWorklet (on Web): `web_audio_worklet`
40+
- AudioWorklet (on Web): `audioworklet`
4141

42-
For AudioWorklet backend usage see the README for the `web-audio-worklet-beep` example.
42+
For AudioWorklet backend usage see the README for the `audioworklet-beep` example.
4343

4444
## ASIO on Windows
4545

File renamed without changes.
File renamed without changes.

examples/web-audio-worklet-beep/Cargo.toml renamed to examples/audioworklet-beep/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "web-audio-worklet-beep"
2+
name = "audioworklet-beep"
33
description = "cpal beep example for WebAssembly on an AudioWorklet"
44
version = "0.1.0"
55
edition = "2018"
@@ -18,7 +18,7 @@ lto = true
1818
#default = ["wee_alloc"]
1919

2020
[dependencies]
21-
cpal = { path = "../..", features = ["wasm-bindgen", "web_audio_worklet"] }
21+
cpal = { path = "../..", features = ["wasm-bindgen", "audioworklet"] }
2222
# `gloo` is a utility crate which improves ergonomics over direct `web-sys` usage.
2323
gloo = "0.11.0"
2424
# The `wasm-bindgen` crate provides the bare minimum functionality needed
File renamed without changes.

0 commit comments

Comments
 (0)