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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(meetings): keep mic and meeting-audio speaker labels apart in transcript text (SCR-705) (#7613)
Ezra Ellette13d960d27f7c
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsxindex 9aedf9f8e..f9ab92849 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx+++ b/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx@@ -29,6 +29,7 @@ import { usePlatform } from "@/lib/hooks/use-platform";import type { LiveCaptureState } from "@/lib/utils/live-capture-state";import {fetchMeetingAudio,+ sourceQualifiedSpeakerName,type MeetingAudioChunk,} from "@/lib/utils/meeting-context";import type { MeetingRecord } from "@/lib/utils/meeting-format";@@ -401,11 +402,7 @@ function compareBlocks(a: SpeakerBlock, b: SpeakerBlock): number {}function displaySpeakerName(block: SpeakerBlock): string {- if (!/^speaker(?:[ _]\d+)?$/i.test(block.speakerName.trim())) return block.speakerName;- // A provider's speaker numbers restart on each stream. Avoid presenting- // unrelated input/output labels as the same identified person.- const source = block.captureDirection === "input" ? "Microphone" : block.captureDirection === "output" ? "Meeting audio" : "Unidentified";- return `${source} · ${block.speakerName}`;+ return sourceQualifiedSpeakerName(block.speakerName, block.captureDirection);}function groupBySpeaker(chunks: MeetingAudioChunk[]): SpeakerBlock[] {@@ -1212,7 +1209,7 @@ export function TranscriptPanel({aria-atomic="true">{latestFinalLiveBlock- ? `${latestFinalLiveBlock.speakerName}: ${latestFinalLiveBlock.text}`+ ? `${displaySpeakerName(latestFinalLiveBlock)}: ${latestFinalLiveBlock.text}`: ""}</span></div>diff --git a/apps/screenpipe-app-tauri/lib/utils/meeting-context.test.ts b/apps/screenpipe-app-tauri/lib/utils/meeting-context.test.tsindex 5993f64b8..3251a67a0 100644--- a/apps/screenpipe-app-tauri/lib/utils/meeting-context.test.ts+++ b/apps/screenpipe-app-tauri/lib/utils/meeting-context.test.ts@@ -10,6 +10,7 @@ import {extractImageDataUrlsFromMarkdown,extractPipePromptBody,mergeMeetingAudioChunks,+ renderMeetingTranscript,type MeetingAudioChunk,type MeetingContext,} from "./meeting-context";@@ -213,6 +214,20 @@ describe("mergeMeetingAudioChunks", () => {});});+describe("renderMeetingTranscript speaker labels", () => {+ it("keeps per-stream provider labels apart for mic and meeting audio", () => {+ const remote = chunk({ speakerName: "speaker 1", source: "live", transcription: "remote turn", timestamp: "2026-06-04T15:00:00Z" });+ const local = chunk({ audioChunkId: 2, speakerName: "speaker 1", source: "live", deviceType: "input", isInput: true, transcription: "local turn", timestamp: "2026-06-04T15:00:03Z" });+ const named = chunk({ audioChunkId: 3, speakerName: "Alice", source: "live", deviceType: "input", isInput: true, transcription: "named turn", timestamp: "2026-06-04T15:00:30Z" });++ const lines = renderMeetingTranscript([remote, local, named]).split("\n");++ expect(lines).toHaveLength(3);+ expect(lines[0]).toContain("[Meeting audio · speaker 1] remote turn");+ expect(lines[1]).toContain("[Microphone · speaker 1] local turn");+ expect(lines[2]).toContain("[Alice] named turn");+ });+});describe("cross-device speech preservation", () => {it.each([diff --git a/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts b/apps/screenpipe-app-tauri/lib/utils/meeting-context.tsindex e3b7b28cc..dc89bc852 100644--- a/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts+++ b/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts@@ -129,6 +129,17 @@ function sortAudioChunks(chunks: MeetingAudioChunk[]): MeetingAudioChunk[] {});}+/** Provider speaker numbers restart on each stream, so qualify generic labels by source. */+export function sourceQualifiedSpeakerName(+ speakerName: string,+ deviceType: string | undefined,+): string {+ if (!/^speaker(?:[ _]\d+)?$/i.test(speakerName.trim())) return speakerName;+ const direction = deviceType?.trim().toLowerCase();+ const source = direction === "input" ? "Microphone" : direction === "output" ? "Meeting audio" : "Unidentified";+ return `${source} · ${speakerName}`;+}+interface SpeakerTurn {speakerName: string;/** Timestamp of the first chunk in this turn — used for display. */@@ -154,7 +165,7 @@ function groupConsecutiveSpeakerTurns(const MAX_GAP_MS = 10_000;const turns: SpeakerTurn[] = [];for (const c of chunks) {- const speakerName = c.speakerName ?? "";+ const speakerName = sourceQualifiedSpeakerName(c.speakerName ?? "", c.deviceType);const text = c.transcription.replace(/\s+/g, " ").trim();if (!text) continue;const last = turns[turns.length - 1];