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: audio timestamp drift during meetings — use processing time not channel entry time

Louis Beaumontdeabda20725f
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 0e606df3d..f2063b056 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -8097,7 +8097,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.516"
+version = "2.0.517"
dependencies = [
"anyhow",
"arboard",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 0e6bff8ca..419d6c2d0 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.516"
+version = "2.0.517"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/crates/screenpipe-audio/src/transcription/stt.rs b/crates/screenpipe-audio/src/transcription/stt.rs
index c8f35df41..47a789666 100644
--- a/crates/screenpipe-audio/src/transcription/stt.rs
+++ b/crates/screenpipe-audio/src/transcription/stt.rs
@@ -105,9 +105,10 @@ pub async fn process_audio_input(
whisper_state: &mut WhisperState,
metrics: Arc<AudioPipelineMetrics>,
) -> Result<()> {
- // Use the capture timestamp from when audio was recorded, not processing time.
- // This is critical for batch/deferred transcription mode where processing
- // may happen minutes or hours after capture.
+ // NOTE: capture_timestamp is set when audio enters the channel, but smart mode
+ // deferral can delay processing by 20+ minutes. The DB now uses Utc::now() at
+ // insert time instead, so this timestamp is only used for TranscriptionResult
+ // metadata (not for DB storage).
let timestamp = audio.capture_timestamp;
let audio_data = if audio.sample_rate != SAMPLE_RATE {
diff --git a/crates/screenpipe-audio/src/transcription/transcription_result.rs b/crates/screenpipe-audio/src/transcription/transcription_result.rs
index 86842d286..55c9d9a05 100644
--- a/crates/screenpipe-audio/src/transcription/transcription_result.rs
+++ b/crates/screenpipe-audio/src/transcription/transcription_result.rs
@@ -4,7 +4,7 @@
use std::sync::Arc;
-use chrono::{TimeZone, Utc};
+use chrono::{DateTime, Utc};
use screenpipe_core::pii_removal::remove_pii;
use screenpipe_db::{DatabaseManager, Speaker};
use tracing::{debug, error, info};
@@ -108,12 +108,13 @@ pub async fn process_transcription_result(
}
}
}
- // Convert capture_timestamp (epoch secs) to DateTime<Utc> for DB insertion
- let capture_ts = if result.timestamp > 0 {
- Utc.timestamp_opt(result.timestamp as i64, 0).single()
- } else {
- None
- };
+ // Use current time for DB insertion instead of capture_timestamp.
+ // The capture_timestamp is set when audio enters the processing channel,
+ // but smart mode meeting deferral creates a growing backlog — by the time
+ // audio is processed, the capture_timestamp can be 20+ minutes stale.
+ // Using None here makes the DB fall back to Utc::now(), which is close
+ // to when the audio was actually processed and the MP4 file was written.
+ let capture_ts: Option<DateTime<Utc>> = None;
match db
.insert_audio_chunk_and_transcription(