Skip to content

Commit

Permalink
An attempt to fix the sound issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneToIgnore committed Nov 20, 2024
1 parent 8b20ce6 commit 22d10c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/live_kit_client/src/live_kit_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 22d10c2

Please sign in to comment.