diff options
| -rw-r--r-- | crates/teleia/src/audio.rs | 4 |
1 files 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"); } } |
