Add post-recording diarization support via cloud STT with speaker labels #18
Labels
No labels
blocked:children
blocked:needs-decision
blocked:needs-human
blocked:verify-failed
bug
deferred
enhancement
feature-request
in-progress
needs-decompose
needs-triage
quickfix
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/transcriber#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent Issue
#6 — No speaker/subject assignment during live recording
#11 — Implementation plan
Description
Per the speaker diarization research (#10), the recommended path is Google Cloud STT batch Recognize with diarization enabled. After a recording completes, the audio can be sent to Google Cloud STT to get speaker-labeled segments, which are then written as SessionTag entries.
Scope
GoogleDiarizationClientthat sends recorded audio to Cloud STT batch Recognize withenableSpeakerDiarization=truespeakerTagper word, aggregate into speaker time-rangesSpeakerentity (named "Speaker 1", "Speaker 2", etc. if not matched to existing)SessionTag(tagType=TYPE_SPEAKER, referenceId=speaker.id, startOffsetMs, endOffsetMs)entriesAcceptance Criteria
Dependencies
⏸ Needs Decision
Blocking factors:
Scope: medium Risk: low Spec: aligned Type: feature
Summary: Adds a 'Diarize' button on the transcript detail screen that sends recorded audio to Google Cloud STT for speaker diarization, creating Speaker entities and SessionTag entries with time ranges.
Suggestion: Create GoogleDiarizationClient using existing OkHttp to call Google Cloud STT speech:recognize with enableSpeakerDiarization=true. Audio file path may need to be stored on RecordingSession or derived from a convention. Parse the response grouping consecutive words by speakerTag into time ranges, create Speaker entities named 'Speaker N', and write SessionTag entries via existing repositories. Extend the ViewModel with a DiarizationState (Idle/Processing/Done/Error) and add an IconButton to TranscriptDetailScreen's top bar that triggers the coroutine. Reuse the cloud API key from BackendSettings or add a dedicated Google Cloud field.
Rationale: Medium scope because it adds a new service module and UI wiring but leverages existing Room entities (Speaker, SessionTag), DAOs, repositories, and OkHttp — no schema changes needed since SessionTag with TYPE_SPEAKER and time-offset infrastructure already exists from #12. Low risk because it's purely additive with no changes to recording/transcription paths, and graceful error handling is specified. Fully aligned with the project's roadmap (parent issues #6, #10, #11). The only open question is how the recorded audio file is referenced post-recording — the service currently doesn't persist the audio path, which may add minor scope to store it on the session.
Action: Review each blocking factor above. Remove
blocked:needs-decisionlabel to route back to triage.Fixed in commit. Closing.