From 22d10c2c9ef4c0799ae6198e1340de12be5de1a1 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 19 Nov 2024 18:34:27 +0200 Subject: [PATCH] An attempt to fix the sound issues --- crates/live_kit_client/src/live_kit_client.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/live_kit_client/src/live_kit_client.rs b/crates/live_kit_client/src/live_kit_client.rs index bb77eafdf7bd80..580b99d4373cb4 100644 --- a/crates/live_kit_client/src/live_kit_client.rs +++ b/crates/live_kit_client/src/live_kit_client.rs @@ -218,8 +218,15 @@ pub fn capture_local_audio_track( ); } if let Some(stream) = &stream { + stream.play().log_err(); + // We need to keep the thread alive and task not dropped, so the `stream` is not dropped. + // `stream` is `!Send` so we cannot move it away anywhere else. loop { - stream.play().log_err(); + std::thread::park(); + // Suppress the unreachable code warning + if false { + break; + } } }