From c3f29c1a37e7cf85f00be22ee87331bce13ef7da Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 16 Dec 2025 00:56:00 -0500 Subject: Delay the stop to prevent the pop --- crates/teleia/src/audio.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/teleia/src/audio.rs b/crates/teleia/src/audio.rs index 9571745..e95a86d 100644 --- a/crates/teleia/src/audio.rs +++ b/crates/teleia/src/audio.rs @@ -31,10 +31,10 @@ impl AudioPlayingHandle { self.node.stop().expect("failed to stop audio"); } pub fn fade_out(&self, ctx: &Context, time: f32) { - let t = ctx.audio.current_time() + time as f64; self.gain.gain().set_target_at_time(0.0, ctx.audio.current_time(), time as f64) .expect("failed to fade out audio"); - // self.node.stop_with_when(t).expect("failed to stop audio while fading out"); + self.node.stop_with_when(ctx.audio.current_time() + time as f64 + 1.0) + .expect("failed to stop audio while fading out"); } } -- cgit v1.2.3