Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix disable audio avoid running record_audio completely

Louis Beaumont8c94ec211a09
diff --git a/screenpipe-server/src/core.rs b/screenpipe-server/src/core.rs
index 5f9165f63..23036cd94 100644
--- a/screenpipe-server/src/core.rs
+++ b/screenpipe-server/src/core.rs
@@ -91,19 +91,26 @@ pub async fn start_continuous_recording(
})
};
- let audio_handle = tokio::spawn(async move {
- record_audio(
- db_manager_audio,
- output_path_audio,
- audio_chunk_duration,
- whisper_sender,
- whisper_receiver,
- audio_devices_control,
- friend_wearable_uid,
- audio_transcription_engine,
- )
- .await
- });
+ let audio_handle = if !audio_disabled {
+ tokio::spawn(async move {
+ record_audio(
+ db_manager_audio,
+ output_path_audio,
+ audio_chunk_duration,
+ whisper_sender,
+ whisper_receiver,
+ audio_devices_control,
+ friend_wearable_uid,
+ audio_transcription_engine,
+ )
+ .await
+ })
+ } else {
+ tokio::spawn(async move {
+ tokio::time::sleep(Duration::from_secs(60)).await;
+ Ok(())
+ })
+ };
// Wait for both tasks to complete
let (video_result, audio_result) = tokio::join!(video_handle, audio_handle);