Skip to content
Open
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
7 changes: 4 additions & 3 deletions src/host/webaudio.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Web Audio backend implementation.
//!
//! Default backend on WebAssembly.
//! Audio callbacks abort on panic because user callbacks need not be unwind-safe.

extern crate js_sys;
extern crate wasm_bindgen;
Expand Down Expand Up @@ -401,7 +402,7 @@ impl DeviceTrait for Device {
let current_time_bits_cb = current_time_bits.clone();

let on_audio_process =
Closure::wrap(Box::new(move |event: AudioProcessingEvent| {
Closure::wrap_aborting(Box::new(move |event: AudioProcessingEvent| {
let now = ctx_cb.current_time();
#[cfg(target_feature = "atomics")]
current_time_bits_cb.store(now.to_bits(), Ordering::Relaxed);
Expand Down Expand Up @@ -703,7 +704,7 @@ impl DeviceTrait for Device {
on_ended_closure
.write()
.unwrap()
.replace(Closure::wrap(Box::new(move || {
.replace(Closure::wrap_aborting(Box::new(move || {
let now = ctx_handle.current_time();

// Keep the shared clock up to date so Stream::now() has a fresh value.
Expand Down Expand Up @@ -1107,7 +1108,7 @@ impl DeviceTrait for Device {
};

let on_audio_process =
Closure::wrap(Box::new(move |event: AudioProcessingEvent| {
Closure::wrap_aborting(Box::new(move |event: AudioProcessingEvent| {
let now = ctx_cb.current_time();
#[cfg(target_feature = "atomics")]
current_time_bits_cb.store(now.to_bits(), Ordering::Relaxed);
Expand Down
Loading