Repository navigation
Description
Problem
User speech profiles (mobile onboarding enroll + later matching) are not reliable enough to trust. Two separate failures:
- Most users never get a real voiceprint. Among people who hit the onboarding speech-profile step, most skip.
- The ones who enroll still get a weak / inconsistent identity. Enroll and later matching do not use the same speaker model, and enroll is a single noisy Q&A WAV with a raw cosine cutoff.
This is the user's own speech profile (POST /v3/upload-audio → users/{uid}/speech_profile.wav + speaker_embedding), not “other people” teaching (#7187, #6039) and not 3+ speaker diarization (#5470).
Evidence (2026-09-04, read-only)
Adoption (PostHog, mobile iOS/Android/iPadOS, noncanonical — no catalog metric):
- 30d: 3,204 finished onboarding; 3,266 hit the speech-profile step; 625 completed (19%), 2,692 skipped (81%). 1,200 later opened Settings → Speech Profile.
- 90d: 8,549 onboarded; 2,017 completed / 6,779 skipped (~23% complete among people who saw the step).
Onboarding Step Speech Profile Completedis the All Done button. Failed uploads still complete onboarding (completeAfterUploadFailurestill setsprofileCompleted). It is not proof the voiceprint landed.
Upload path (prod Cloud Run backend, POST /v3/upload-audio, 2026-08-29 → 2026-09-04, counts only):
- 553 requests: 444 × 200 (80%), 108 × 400 (20%), 1 × 500.
- Embeddings stored on almost every 200 (3 extract failures in the week).
- 400s were dominated by the old 120s duration cap (known ~28% of onboarding uploads).
aee08dc(2026-08-31) raised the cap to 180s; 400s fell from 40 on Aug 31 → 5–6/day → 0 so far on Sep 4.
Could not count gs://speech-profiles objects (RO bot lacks storage.objects.list).
Accuracy architecture (origin/main):
- Enroll + live listen match:
HOSTED_SPEAKER_EMBEDDING_API_URL/v2/embedding= pyannote/wespeaker-voxceleb-resnet34-LM, cosine 0.45, clips ≤10s. - Post-process match:
HOSTED_SPEECH_PROFILE_API_URL= SpeechBrain ECAPA-TDNN (speechbrain/spkrec-ecapa-voxceleb) on the WAV viaverify_files. - Same user, two embedding spaces. VAD trim on enroll is pyannote VAD with Silero ONNX fallback; multi-speaker reject is client-only.
Goal
A user who records the onboarding Q&A (or Settings recapture) should get a voiceprint that consistently marks their speech as them on later listens, without a second incompatible matcher.
Scope (3 items)
- Unify on one embedding stack. Enroll, live
SpeakerMatcher, and post-process identification must use the same model and the stored vector. Remove SpeechBrainverify_filesas a parallel identity path. - Better enroll method, then a better small model. Centroid of the six answers (not one concatenated WAV); server-side single-speaker + min-speech-after-VAD gates; AS-Norm / relative ranking instead of a raw 0.45 cutoff. Swap ResNet34-LM for ERes2NetV2 or CAM++ in the existing diarizer
/v2/embeddingservice (short-clip SV, not a 580M SSL model). - Honest telemetry. Distinct events for skip / upload 200 / upload 4xx / embedding stored / live match accept|reject. Stop treating All Done as enroll success.
Out of scope
- 3+ speaker clustering / diarization ([P1] Speaker diarization accuracy drops significantly with 3+ speakers #5470, Backend: Offline agglomerative clustering for robust 3+ speaker diarization (#5470) #8917).
- Teaching other people’s profiles (Bug: Other people’s voice profiles are not showing or identifying automatically. #7187, Longer Speaker Training for Speakers #6039), except they should ride the same unified embedding once it exists.
- STT WER / vocabulary / VAD onset (Strategy: Self-Improving Transcription & Diarization Quality #5565) except where enroll audio quality is gated.
- Listing the speech-profiles bucket or dumping user docs.
Acceptance
- One embedding model ID on enroll write and live/post read; a test fails if those paths disagree.
- Onboarding complete no longer implies a stored profile; Settings can recapture.
- Prod: upload 4xx rate stays low after the 180s cap; new match telemetry exists; skip vs success remain separate.
Related
- Strategy: Self-Improving Transcription & Diarization Quality #5565 (broad STT/diarization strategy; item 6 threshold only)
- Longer Speaker Training for Speakers #6039 (longer training for other speakers)
- Bug: Other people’s voice profiles are not showing or identifying automatically. #7187 (other people’s profiles not auto-identifying)
- Bug: Deleting a Speaker's Speech Profile Does Not Create a New One #5084 / Bug: Diarization broken — stale speech samples block new profiles, no delete UI #5266 (delete / stale samples)
Activity
fix(app,backend): disconnect nags, WAL opus sync, speech-profile iden…
fix(app,backend): disconnect nags, WAL opus sync, speech-profile iden…
Git-on-my-level commentedon Sep 9, 2026
Closed by #12893 (merge commit d324a95): /v3/upload-audio now extracts and stores the speaker embedding before overwriting GCS profile audio (503 on extract/store failure, so a 200 means the voiceprint landed), and onboarding enroll telemetry now distinguishes skip/continue from upload/embedding success. The broader matching-quality rework landed earlier in #12935.