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: timeline play button shows more reliably when audio exists nearby

Louis Beaumontec4d998a4793
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-audio-playback.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-audio-playback.tsx
index 6a6f45814..f7e1a74e4 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-audio-playback.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-audio-playback.tsx
@@ -139,14 +139,16 @@ export function useAudioPlayback({
const mutedDevicesRef = useRef<Set<string>>(new Set());
mutedDevicesRef.current = mutedDevices;
- // Check if there's audio nearby the current position (within 60s window)
+ // Check if there's audio nearby the current position (within 120s window)
+ // Uses a wider index scan (±200) so sparse event-driven frames don't miss
+ // nearby audio that the subtitle bar would show.
const hasAudioNearby = (() => {
if (frames.length === 0) return false;
const curr = frames[currentIndex];
if (!curr) return false;
const currTime = new Date(curr.timestamp).getTime();
- const windowMs = 60_000;
- for (let i = Math.max(0, currentIndex - 30); i < Math.min(frames.length, currentIndex + 30); i++) {
+ const windowMs = 120_000;
+ for (let i = Math.max(0, currentIndex - 200); i < Math.min(frames.length, currentIndex + 200); i++) {
const f = frames[i];
if (!f) continue;
const ft = new Date(f.timestamp).getTime();