Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

feat: voice profile panel per speaker with samples, variants and removal, voice spaces and calibrated thresholds on the admin card, and docs for sample-based voice matching

Murtaza Nasir2cc738c5b583
diff --git a/config/env.asr.example b/config/env.asr.example
index 8b3b3d24..15e414d9 100644
--- a/config/env.asr.example
+++ b/config/env.asr.example
@@ -444,6 +444,10 @@ JOB_QUEUE_WORKERS=2
# Set to true to disable it. Costs one short transcription per run.
# DISABLE_VOICE_EMBEDDING_CHECK=false
+# Voice profiles: a speaker needs at least this much speech in a recording
+# before it trains a voice profile or is auto-labelled (seconds, default 15).
+# VOICE_PROFILE_MIN_SPEECH_SECONDS=15
+
# Summary queue workers (for LLM summarization, default: 2)
SUMMARY_QUEUE_WORKERS=2
diff --git a/config/env.transcription.example b/config/env.transcription.example
index 90daa186..d55be104 100644
--- a/config/env.transcription.example
+++ b/config/env.transcription.example
@@ -308,6 +308,10 @@ CHUNK_OVERLAP_SECONDS=3
# reference, and on demand from the admin page. Set to true to disable it.
# Costs one short transcription per run.
# DISABLE_VOICE_EMBEDDING_CHECK=false
+
+# Voice profiles: a speaker needs at least this much speech in a recording
+# before it trains a voice profile or is auto-labelled (seconds, default 15).
+# VOICE_PROFILE_MIN_SPEECH_SECONDS=15
#
# --- OpenAI Whisper (Legacy, no diarization) ---
# TRANSCRIPTION_API_KEY=sk-xxx
diff --git a/config/env.whisperx.example b/config/env.whisperx.example
index 57850390..ef6c485b 100644
--- a/config/env.whisperx.example
+++ b/config/env.whisperx.example
@@ -116,6 +116,10 @@ ASR_RETURN_SPEAKER_EMBEDDINGS=true
# Costs one short transcription per run.
# DISABLE_VOICE_EMBEDDING_CHECK=false
+# Voice profiles: a speaker needs at least this much speech in a recording
+# before it trains a voice profile or is auto-labelled (seconds, default 15).
+# VOICE_PROFILE_MIN_SPEECH_SECONDS=15
+
# --- Application Settings ---
# Set to "true" to allow user registration, "false" to disable
ALLOW_REGISTRATION=false
diff --git a/docs/features.md b/docs/features.md
index 3629034b..40cef292 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -129,7 +129,11 @@ Implement intelligent data lifecycle management with flexible retention policies
Build and maintain a library of speaker profiles that persist across recordings. [Identify speakers](user-guide/transcripts.md#speaker-identification) after each transcription to build your library. Once identified, speakers are remembered and suggested in future recordings. The system tracks usage statistics, showing how often each speaker appears and when they were last identified. Bulk management tools help maintain a clean, organized speaker library.
-**Voice Profile Recognition**: The system builds voice recognition profiles from speaker identifications across multiple recordings. These profiles use voice embeddings supplied by the transcription backend (256-dimensional with WhisperX, though nothing in Speakr requires that size) to suggest speaker matches when processing new recordings, making speaker identification faster and more consistent. The voice matching system calculates similarity scores to help identify speakers across recordings, even when audio quality varies. Voice profiles are automatically updated as more recordings are processed, improving recognition accuracy over time.
+**Voice Profile Recognition**: A person's voice profile is built from samples: each time you name someone in a recording, Speakr keeps that recording's voice embedding for them (up to 20 per person, oldest dropped first). Embeddings of any size work; WhisperX returns 256 dimensions. Samples that closely resemble each other form a voice variant, so the same person on a phone and in a meeting room can have two, and a new recording is compared with every variant, the closest one counting. The variants are always rebuilt from the samples, which makes corrections complete: renaming a speaker moves their sample to the right person, and removing a sample in **Account, Speakers Management, Voice profile** undoes its effect entirely.
+
+Several safeguards keep profiles clean. A speaker with less than 15 seconds of speech in a recording (`VOICE_PROFILE_MIN_SPEECH_SECONDS`) neither trains a profile nor gets auto-labelled, since such a short stretch gives a noisy embedding. A sample that is unlike everything a well-established profile already holds is kept out and logged as a likely wrong name. Samples from auto-labelling count half as much as names a person confirmed, and confirming the name in the speaker dialog upgrades them. Profiles built before this design are kept and read as one sample, weighted by how many recordings built them.
+
+Match thresholds calibrate themselves: once a voice space holds enough samples, Speakr compares each sample with the same person's other samples and with other people's, and places the threshold between the two distributions. Suggestions and the low / medium / high auto-labelling settings are derived from it; until then the fixed defaults apply. The admin **Voice embedding compatibility** card shows the threshold in use.
**In-App Notifications**: The user menu carries an unread badge and a panel listing anything that needs attention, such as a change in the transcription backend's voice embedding model. Notices that describe a condition rather than an event clear themselves when the condition ends, so restoring a backend removes the warning without anyone dismissing it. Notification text is localized like the rest of the interface.
@@ -137,11 +141,11 @@ Build and maintain a library of speaker profiles that persist across recordings.
**Embedding Model Changes**: Voice profiles are only comparable with embeddings from the model that produced them. If the transcription backend starts returning embeddings from a different model, whether because the endpoint was repointed or because the service upgraded itself, existing profiles stop matching anything. On its own this failure is silent: matching simply returns nothing.
-Speakr detects it by sending a short fixed clip to the backend and comparing the embedding it gets back against the one recorded when voice matching first worked. The check runs at startup, which is when an embedding model realistically changes, and on demand from the **Voice embedding compatibility** card on the Admin page, which also shows the current verdict, the embedding size and when it was last checked. When it detects a change, Speakr writes a banner into the startup log and raises a notification for every administrator, keeping the original reference so that restoring the previous backend clears both by itself. If the change was intended, rebuild the affected voice profiles and then use **Re-baseline** on that card to accept the new model; it asks for confirmation, because it discards the reference the old profiles were built against. A backend that is simply unreachable is reported as a failed check rather than a changed model.
+Speakr detects it by sending a short fixed clip to the backend and comparing the embedding it gets back against the one recorded when voice matching first worked. Each model it recognises this way gets its own **voice space**, and embeddings are only compared within one space: profiles are kept separately per model, so switching from WhisperX to OpenASR and back leaves each backend's profiles intact, and a new model starts learning its own profiles as you name speakers. Profiles stored before voice spaces existed belong to the space of the model the reference was taken from. With the check disabled, nothing is assigned a space and matching works as before. The check runs at startup, which is when an embedding model realistically changes, and on demand from the **Voice embedding compatibility** card on the Admin page, which also shows the current verdict, the embedding size and when it was last checked. When it detects a change, Speakr writes a banner into the startup log and raises a notification for every administrator, keeping the original reference so that restoring the previous backend clears both by itself. If the change was intended, use **Re-baseline** on that card to accept the new model and clear the warning; the previous model's profiles stay in their own space and match again if that backend is restored. A backend that is simply unreachable is reported as a failed check rather than a changed model.
Set `DISABLE_VOICE_EMBEDDING_CHECK=true` to turn the check off. The clip costs one short transcription each time it runs.
-**Auto Speaker Labeling**: Enable automatic speaker identification in your [account settings](user-guide/settings.md#processing-preferences). When enabled, new recordings are automatically analyzed against your speaker profiles, and matching speakers are labeled without manual intervention. Configure the confidence threshold to balance between more matches (low threshold) and higher accuracy (high threshold). This feature requires WhisperX ASR with speaker embeddings enabled.
+**Auto Speaker Labeling**: Enable automatic speaker identification in your [account settings](user-guide/settings.md#processing-preferences). When enabled, new recordings are automatically analyzed against your speaker profiles, and matching speakers are labeled without manual intervention. Each person is given to at most one speaker in a recording, and a speaker whose two best candidates are nearly tied is left for you. Configure the confidence threshold to balance between more matches (low threshold) and higher accuracy (high threshold). This feature requires WhisperX ASR with speaker embeddings enabled.
**Speaker Profile Preservation**: By default, speaker profiles and voice embeddings are preserved even when all associated recordings are deleted. Set `DELETE_ORPHANED_SPEAKERS=true` to automatically clean up speakers with no remaining recordings.
diff --git a/docs/user-guide/settings.md b/docs/user-guide/settings.md
index 914462d5..d6daf174 100644
--- a/docs/user-guide/settings.md
+++ b/docs/user-guide/settings.md
@@ -199,7 +199,8 @@ Each speaker card displays essential information in a clean, scannable format. T
For speakers with voice recognition data, each card displays additional information:
- **Voice Profile Badge**: Shows confidence level (high/medium/low) based on the number and quality of voice samples collected
-- **Sample Count**: Number of voice embeddings collected from different recordings, helping assess profile strength
+- **Sample Count**: Number of voice samples the profile is built from, and how many voice variants they form (for example the same person on a phone and in a room)
+- **Voice Profile**: Lists every sample with its recording, speaker label, speech time and whether it was confirmed or auto-labelled. Remove a sample that belongs to someone else and the profile is rebuilt without it
- **Voice Samples Button**: Click to hear representative audio clips of this speaker's voice for verification
- **Profile Strength Indicator**: Visual feedback showing how well the system can recognize this speaker in future recordings
diff --git a/src/api/speakers.py b/src/api/speakers.py
index b8593e6d..6da046a3 100644
--- a/src/api/speakers.py
+++ b/src/api/speakers.py
@@ -56,7 +56,18 @@ def get_speakers():
speakers = Speaker.query.filter_by(user_id=current_user.id)\
.order_by(Speaker.use_count.desc(), Speaker.last_used.desc())\
.all()
- return jsonify([speaker.to_dict() for speaker in speakers])
+ # Voice profile counts (samples, variants) from one query for all.
+ from src.models import SpeakerVoiceSample
+ from src.services.voice_profiles import voice_summary
+ rows_by_speaker = {}
+ for row in SpeakerVoiceSample.query.filter_by(user_id=current_user.id).all():
+ rows_by_speaker.setdefault(row.speaker_id, []).append(row)
+ out = []
+ for speaker in speakers:
+ item = speaker.to_dict()
+ item['voice'] = voice_summary(speaker, rows_by_speaker.get(speaker.id, []))
+ out.append(item)
+ return jsonify(out)
except Exception as e:
current_app.logger.error(f"Error fetching speakers: {e}")
return jsonify({'error': str(e)}), 500
@@ -373,6 +384,65 @@ def get_speaker_recordings(speaker_id):
return jsonify({'error': str(e)}), 500
+@speakers_bp.route('/speakers/<int:speaker_id>/voice_samples', methods=['GET'])
+@login_required
+def list_voice_samples(speaker_id):
+ """The samples a person's voice profile is built from, newest first."""
+ from src.models import SpeakerVoiceSample
+ from src.services.voice_profiles import voice_summary, effective_space, current_space_id
+ speaker = Speaker.query.filter_by(id=speaker_id, user_id=current_user.id).first()
+ if not speaker:
+ return jsonify({'error': 'Speaker not found'}), 404
+ rows = SpeakerVoiceSample.query.filter_by(speaker_id=speaker.id).all()
+ titles = {}
+ rec_ids = [r.recording_id for r in rows if r.recording_id]
+ if rec_ids:
+ for rec in Recording.query.filter(Recording.id.in_(rec_ids)).all():
+ titles[rec.id] = rec.title
+ current = effective_space(current_space_id())
+ samples = []
+ if not rows and speaker.average_embedding:
+ # A profile from before samples existed: shown as one entry so it can
+ # be seen and removed like any sample (removing it clears the profile).
+ samples.append({'id': None, 'speaker_id': speaker.id, 'recording_id': None, 'label': None,
+ 'source': 'legacy', 'weight': float(min(max(speaker.embedding_count or 1, 1), 5)),
+ 'speech_seconds': None, 'space_id': None, 'recording_title': None,
+ 'in_current_space': effective_space(None) == current,
+ 'created_at': speaker.created_at.isoformat() if speaker.created_at else None})
+ for r in sorted(rows, key=lambda r: r.updated_at or r.created_at, reverse=True):
+ item = r.to_dict()
+ item['recording_title'] = titles.get(r.recording_id)
+ item['in_current_space'] = effective_space(r.space_id) == current
+ samples.append(item)
+ return jsonify({'summary': voice_summary(speaker, rows), 'samples': samples})
+
+
+@speakers_bp.route('/speakers/<int:speaker_id>/voice_samples/<int:sample_id>', methods=['DELETE'])
+@login_required
+def delete_voice_sample(speaker_id, sample_id):
+ """Remove one sample; the person's voice variants are rebuilt without it."""
+ from src.models import SpeakerVoiceSample
+ from src.services import voice_profiles as vp
+ speaker = Speaker.query.filter_by(id=speaker_id, user_id=current_user.id).first()
+ if not speaker:
+ return jsonify({'error': 'Speaker not found'}), 404
+ sample = SpeakerVoiceSample.query.filter_by(id=sample_id, speaker_id=speaker.id).first()
+ if not sample:
+ return jsonify({'error': 'Sample not found'}), 404
+ try:
+ db.session.delete(sample)
+ db.session.flush()
+ vp.refresh_speaker_summary(speaker)
+ vp._calibration_cache.clear()
+ db.session.commit()
+ return jsonify({'success': True, 'summary': vp.voice_summary(speaker),
+ 'speaker': speaker.to_dict()})
+ except Exception as e:
+ db.session.rollback()
+ current_app.logger.error(f"Error removing voice sample {sample_id}: {e}")
+ return jsonify({'error': 'Could not remove the sample'}), 500
+
+
@speakers_bp.route('/speakers/<int:speaker_id>/clear_embeddings', methods=['POST'])
@login_required
def clear_speaker_embeddings(speaker_id):
diff --git a/src/services/voice_embedding_check.py b/src/services/voice_embedding_check.py
index adf8e959..2faf3c78 100644
--- a/src/services/voice_embedding_check.py
+++ b/src/services/voice_embedding_check.py
@@ -394,6 +394,14 @@ def spaces_status():
for (space_id,) in SpeakerVoiceSample.query.with_entities(SpeakerVoiceSample.space_id).all():
key = vp.effective_space(space_id)
counts[key] = counts.get(key, 0) + 1
+ # Profiles from before samples existed count as one sample each in
+ # the legacy space until their next update writes them out.
+ from src.models import Speaker
+ with_samples = {sid for (sid,) in SpeakerVoiceSample.query.with_entities(SpeakerVoiceSample.speaker_id).distinct()}
+ legacy_only = sum(1 for (sid,) in Speaker.query.filter(Speaker.average_embedding.isnot(None))
+ .with_entities(Speaker.id).all() if sid not in with_samples)
+ if legacy_only and legacy is not None:
+ counts[legacy] = counts.get(legacy, 0) + legacy_only
out = []
for space in VoiceEmbeddingSpace.query.order_by(VoiceEmbeddingSpace.id).all():
item = space.to_dict()
diff --git a/src/services/voice_profiles.py b/src/services/voice_profiles.py
index a01a8d35..65f29ea2 100644
--- a/src/services/voice_profiles.py
+++ b/src/services/voice_profiles.py
@@ -421,10 +421,11 @@ def refresh_speaker_summary(speaker):
speaker.embeddings_history = history
-def voice_summary(speaker):
+def voice_summary(speaker, rows=None):
"""Counts for the speakers list: samples and variants per space."""
from src.models import SpeakerVoiceSample
- rows = SpeakerVoiceSample.query.filter_by(speaker_id=speaker.id).all()
+ if rows is None:
+ rows = SpeakerVoiceSample.query.filter_by(speaker_id=speaker.id).all()
space = current_space_id()
current = samples_for(speaker, space, rows)
stored_current = len([s for s in current if s.row is not None])
diff --git a/static/locales/de.json b/static/locales/de.json
index 875612d2..73458ed3 100644
--- a/static/locales/de.json
+++ b/static/locales/de.json
@@ -328,14 +328,21 @@
"viewFullPromptStructure": "Vollständige LLM-Prompt-Struktur anzeigen",
"voiceEmbedding": {
"checkNow": "Jetzt prüfen",
+ "current": "aktuell",
"dimension": "Dimensionen",
"help": "Prüft, ob der Transkriptionsdienst weiterhin Stimm-Embeddings liefert, die zu den gespeicherten Stimmprofilen passen, indem ein kurzer mitgelieferter Clip gesendet und das Ergebnis mit einer Referenz verglichen wird. Läuft beim Start; mit „Jetzt prüfen“ erneut ausführen.",
"lastChecked": "Zuletzt geprüft",
+ "lastSeen": "Zuletzt gesehen",
+ "notCalibrated": "Standard (noch zu wenige Proben)",
"rebaseline": "Referenz neu setzen",
- "rebaselineConfirm": "Das Neusetzen übernimmt das aktuelle Backend als neue Referenz. Vorhandene Stimmprofile aus dem vorherigen Modell werden nicht mehr gemeldet, und das Wiederherstellen dieses Backends macht dies nicht rückgängig. Erstellen Sie die betroffenen Profile zuerst neu. Fortfahren?",
+ "rebaselineConfirm": "Die Neufestlegung übernimmt das aktuelle Backend als Referenz und entfernt die Warnung. Stimmprofile des vorherigen Modells bleiben erhalten und passen wieder, wenn dieses Backend wiederhergestellt wird. Fortfahren?",
+ "samples": "Proben",
+ "space": "Raum",
+ "spacesTitle": "Stimmräume (einer je Embedding-Modell)",
"statusChanged": "Modell geändert",
"statusOk": "Kompatibel",
"statusUnknown": "Nicht geprüft",
+ "threshold": "Schwellenwert",
"title": "Kompatibilität der Stimm-Embeddings"
},
"warning": "Warnung",
@@ -1499,7 +1506,7 @@
"dismiss": "Ausblenden",
"empty": "Nichts erfordert Ihre Aufmerksamkeit.",
"view": "Ansehen",
- "voiceEmbeddingChanged": "Der Transkriptionsdienst liefert andere Stimm-Embeddings, daher passen vorhandene Stimmprofile nicht mehr zu neuen Aufnahmen. Stellen Sie das vorherige Backend wieder her oder erstellen Sie die Profile neu und setzen Sie die Referenz zurück."
+ "voiceEmbeddingChanged": "Der Transkriptionsdienst liefert Stimm-Embeddings eines anderen Modells. Stimmprofile werden je Modell getrennt geführt: Profile des vorherigen Modells passen nicht zu neuen Aufnahmen und kehren zurück, wenn Sie das vorherige Backend wiederherstellen; Profile für das neue Modell entstehen, sobald Sie Sprecher benennen."
},
"preferences": {
"description": "Einstellungen zu Anzeige und Editor-Verhalten. Diese werden in deinem Konto gespeichert und gelten geräteübergreifend.",
@@ -2109,6 +2116,22 @@
"uploadProgress": {
"title": "Upload-Fortschritt"
},
+ "voiceProfiles": {
+ "anotherModel": "anderes Modell",
+ "auto": "automatisch zugeordnet",
+ "confirmed": "bestätigt",
+ "deletedRecording": "Gelöschte Aufnahme",
+ "empty": "Keine Stimmproben.",
+ "hint": "Der Stimmabgleich vergleicht neue Aufnahmen mit diesen Proben. Entfernen Sie eine Probe, die zu jemand anderem gehört.",
+ "legacy": "Früheres Stimmprofil",
+ "legacyWeight": "Gewicht {{count}}",
+ "manage": "Stimmprofil",
+ "otherModel": "{{count}} von einem anderen Modell",
+ "remove": "Diese Probe entfernen",
+ "samples": "{{count}} Probe",
+ "samplesPlural": "{{count}} Proben",
+ "variantsPlural": "{{count}} Stimmvarianten"
+ },
"webhooks": {
"title": "Webhooks",
"subtitle": "HTTP-Benachrichtigungen empfangen, wenn sich Aufnahmen ändern. Jeder Endpunkt wird mit HMAC-SHA256 signiert, damit Empfänger die Echtheit prüfen können.",
diff --git a/static/locales/en.json b/static/locales/en.json
index 535fd0d8..76282adc 100644
--- a/static/locales/en.json
+++ b/static/locales/en.json
@@ -328,14 +328,21 @@
"viewFullPromptStructure": "View Full LLM Prompt Structure",
"voiceEmbedding": {
"checkNow": "Check now",
+ "current": "current",
"dimension": "Dimensions",
"help": "Checks that the transcription backend still produces voice embeddings compatible with the stored voice profiles, by sending a short bundled clip and comparing the result with a reference. Runs at startup; use Check now to run it again.",
"lastChecked": "Last checked",
+ "lastSeen": "Last seen",
+ "notCalibrated": "default (not enough samples yet)",
"rebaseline": "Re-baseline",
- "rebaselineConfirm": "Re-baselining accepts the current backend as the new reference. Existing voice profiles built against the previous model will no longer be flagged, and restoring that backend will not undo this. Rebuild the affected profiles first. Continue?",
+ "rebaselineConfirm": "Re-baselining accepts the current backend as the reference and clears the warning. Voice profiles from the previous model are kept, and they match again if that backend is restored. Continue?",
+ "samples": "Samples",
+ "space": "Space",
+ "spacesTitle": "Voice spaces (one per embedding model)",
"statusChanged": "Model changed",
"statusOk": "Compatible",
"statusUnknown": "Not checked",
+ "threshold": "Match threshold",
"title": "Voice embedding compatibility"
},
"warning": "warning",
@@ -1499,7 +1506,7 @@
"dismiss": "Dismiss",
"empty": "Nothing needs your attention.",
"view": "View",
- "voiceEmbeddingChanged": "The transcription service is returning different voice embeddings, so existing voice profiles will not match new recordings. Restore the previous backend, or rebuild the profiles and reset the reference."
+ "voiceEmbeddingChanged": "The transcription service is returning voice embeddings from a different model. Voice profiles are kept separately for each model: profiles from the previous model will not match new recordings and come back if you restore the previous backend, and profiles for the new model are learned as you name speakers."
},
"preferences": {
"description": "Display and editor behaviour preferences. These settings are saved to your account and apply across devices.",
@@ -2109,6 +2116,22 @@
"uploadProgress": {
"title": "Upload Progress"
},
+ "voiceProfiles": {
+ "anotherModel": "another model",
+ "auto": "auto-labelled",
+ "confirmed": "confirmed",
+ "deletedRecording": "Deleted recording",
+ "empty": "No voice samples.",
+ "hint": "Voice matching compares new recordings with these samples. Remove one that belongs to someone else.",
+ "legacy": "Earlier voice profile",
+ "legacyWeight": "weight {{count}}",
+ "manage": "Voice profile",
+ "otherModel": "{{count}} from another model",
+ "remove": "Remove this sample",
+ "samples": "{{count}} sample",
+ "samplesPlural": "{{count}} samples",
+ "variantsPlural": "{{count}} voice variants"
+ },
"webhooks": {
"title": "Webhooks",
"subtitle": "Receive HTTP notifications when recordings change. Each endpoint is signed with HMAC-SHA256 so receivers can verify authenticity.",
diff --git a/static/locales/es.json b/static/locales/es.json
index b2b79f93..e6c4bba1 100644
--- a/static/locales/es.json
+++ b/static/locales/es.json
@@ -328,14 +328,21 @@
"viewFullPromptStructure": "Ver Estructura Completa del Prompt LLM",
"voiceEmbedding": {
"checkNow": "Comprobar ahora",
+ "current": "actual",
"dimension": "Dimensiones",
"help": "Comprueba que el servicio de transcripción sigue produciendo incrustaciones de voz compatibles con los perfiles de voz guardados, enviando un clip breve incluido y comparando el resultado con una referencia. Se ejecuta al iniciar; use Comprobar ahora para repetirlo.",
"lastChecked": "Última comprobación",
+ "lastSeen": "Visto por última vez",
+ "notCalibrated": "predeterminado (aún pocas muestras)",
"rebaseline": "Restablecer referencia",
- "rebaselineConfirm": "Restablecer la referencia acepta el backend actual como nueva referencia. Los perfiles de voz creados con el modelo anterior dejarán de señalarse, y restaurar ese backend no lo deshará. Reconstruya primero los perfiles afectados. ¿Continuar?",
+ "rebaselineConfirm": "Restablecer la referencia acepta el backend actual y elimina la advertencia. Los perfiles de voz del modelo anterior se conservan y vuelven a coincidir si se restaura ese backend. ¿Continuar?",
+ "samples": "Muestras",
+ "space": "Espacio",
+ "spacesTitle": "Espacios de voz (uno por modelo de embeddings)",
"statusChanged": "Modelo cambiado",
"statusOk": "Compatible",
"statusUnknown": "Sin comprobar",
+ "threshold": "Umbral",
"title": "Compatibilidad de las incrustaciones de voz"
},
"warning": "advertencia",
@@ -1499,7 +1506,7 @@
"dismiss": "Descartar",
"empty": "No hay nada que requiera su atención.",
"view": "Ver",
- "voiceEmbeddingChanged": "El servicio de transcripción devuelve embeddings de voz distintos, por lo que los perfiles de voz existentes no coincidirán con las grabaciones nuevas. Restaure el backend anterior, o reconstruya los perfiles y restablezca la referencia."
+ "voiceEmbeddingChanged": "El servicio de transcripción devuelve embeddings de voz de otro modelo. Los perfiles de voz se guardan por separado para cada modelo: los del modelo anterior no coincidirán con las grabaciones nuevas y vuelven si restaura el backend anterior, y los del modelo nuevo se aprenden a medida que nombra a los hablantes."
},
"preferences": {
"description": "Preferencias de visualización y comportamiento del editor. Estos ajustes se guardan en tu cuenta y se aplican en todos los dispositivos.",
@@ -2109,6 +2116,22 @@
"uploadProgress": {
"title": "Progreso de Carga"
},
+ "voiceProfiles": {
+ "anotherModel": "otro modelo",
+ "auto": "asignada automáticamente",
+ "confirmed": "confirmada",
+ "deletedRecording": "Grabación eliminada",
+ "empty": "No hay muestras de voz.",
+ "hint": "La comparación de voz contrasta las grabaciones nuevas con estas muestras. Elimine una que pertenezca a otra persona.",
+ "legacy": "Perfil de voz anterior",
+ "legacyWeight": "peso {{count}}",
+ "manage": "Perfil de voz",
+ "otherModel": "{{count}} de otro modelo",
+ "remove": "Eliminar esta muestra",
+ "samples": "{{count}} muestra",
+ "samplesPlural": "{{count}} muestras",
+ "variantsPlural": "{{count}} variantes de voz"
+ },
"webhooks": {
"title": "Webhooks",
"subtitle": "Reciba notificaciones HTTP cuando cambien las grabaciones. Cada endpoint está firmado con HMAC-SHA256 para que los receptores puedan verificar la autenticidad.",
diff --git a/static/locales/fr.json b/static/locales/fr.json
index 9c2b3674..db4fccef 100644
--- a/static/locales/fr.json
+++ b/static/locales/fr.json
@@ -328,14 +328,21 @@
"viewFullPromptStructure": "Voir la Structure Complète de l'Invite LLM",
"voiceEmbedding": {
"checkNow": "Vérifier maintenant",
+ "current": "actuel",
"dimension": "Dimensions",
"help": "Vérifie que le service de transcription produit toujours des empreintes vocales compatibles avec les profils vocaux enregistrés, en envoyant un court extrait fourni et en comparant le résultat à une référence. S'exécute au démarrage ; utilisez Vérifier maintenant pour relancer.",
"lastChecked": "Dernière vérification",
+ "lastSeen": "Vu pour la dernière fois",
+ "notCalibrated": "par défaut (pas encore assez d’échantillons)",
"rebaseline": "Réinitialiser la référence",
- "rebaselineConfirm": "La réinitialisation adopte le service actuel comme nouvelle référence. Les profils vocaux créés avec l'ancien modèle ne seront plus signalés, et rétablir ce service ne l'annulera pas. Reconstruisez d'abord les profils concernés. Continuer ?",
+ "rebaselineConfirm": "La nouvelle référence accepte le backend actuel et supprime l’avertissement. Les profils vocaux du modèle précédent sont conservés et correspondent de nouveau si ce backend est rétabli. Continuer ?",
+ "samples": "Échantillons",
+ "space": "Espace",
+ "spacesTitle": "Espaces vocaux (un par modèle d’embeddings)",
"statusChanged": "Modèle modifié",
"statusOk": "Compatible",
"statusUnknown": "Non vérifié",
+ "threshold": "Seuil",
"title": "Compatibilité des empreintes vocales"
},
"warning": "avertissement",
@@ -1499,7 +1506,7 @@
"dismiss": "Masquer",
"empty": "Rien ne requiert votre attention.",
"view": "Afficher",
- "voiceEmbeddingChanged": "Le service de transcription renvoie des empreintes vocales différentes : les profils vocaux existants ne correspondront donc pas aux nouveaux enregistrements. Rétablissez le service précédent, ou reconstruisez les profils et réinitialisez la référence."
+ "voiceEmbeddingChanged": "Le service de transcription renvoie des embeddings vocaux d’un autre modèle. Les profils vocaux sont conservés séparément pour chaque modèle : ceux du modèle précédent ne correspondront pas aux nouveaux enregistrements et reviennent si vous rétablissez le backend précédent, et ceux du nouveau modèle se construisent à mesure que vous nommez les intervenants."
},
"preferences": {
"description": "Préférences d'affichage et de comportement de l'éditeur. Ces paramètres sont enregistrés sur votre compte et s'appliquent à tous les appareils.",
@@ -2109,6 +2116,22 @@
"uploadProgress": {
"title": "Progression du Téléchargement"
},
+ "voiceProfiles": {
+ "anotherModel": "autre modèle",
+ "auto": "attribué automatiquement",
+ "confirmed": "confirmé",
+ "deletedRecording": "Enregistrement supprimé",
+ "empty": "Aucun échantillon vocal.",
+ "hint": "La reconnaissance vocale compare les nouveaux enregistrements à ces échantillons. Supprimez celui qui appartient à quelqu’un d’autre.",
+ "legacy": "Profil vocal antérieur",
+ "legacyWeight": "poids {{count}}",
+ "manage": "Profil vocal",
+ "otherModel": "{{count}} d’un autre modèle",
+ "remove": "Supprimer cet échantillon",
+ "samples": "{{count}} échantillon",
+ "samplesPlural": "{{count}} échantillons",
+ "variantsPlural": "{{count}} variantes de voix"
+ },
"webhooks": {
"title": "Webhooks",
"subtitle": "Recevez des notifications HTTP lorsque les enregistrements changent. Chaque endpoint est signé en HMAC-SHA256 pour que les récepteurs puissent vérifier l'authenticité.",
diff --git a/static/locales/pt-BR.json b/static/locales/pt-BR.json
index 5d41a3cb..191f96f1 100644
--- a/static/locales/pt-BR.json
+++ b/static/locales/pt-BR.json
@@ -328,14 +328,21 @@
"viewFullPromptStructure": "Ver Estrutura Completa da Instrução do LLM",
"voiceEmbedding": {
"checkNow": "Verificar agora",
+ "current": "atual",
"dimension": "Dimensões",
"help": "Verifica se o serviço de transcrição continua produzindo embeddings de voz compatíveis com os perfis de voz salvos, enviando um clipe curto incluído e comparando o resultado com uma referência. Executa na inicialização; use Verificar agora para repetir.",
"lastChecked": "Última verificação",
+ "lastSeen": "Visto por último",
+ "notCalibrated": "padrão (ainda poucas amostras)",
"rebaseline": "Redefinir referência",
- "rebaselineConfirm": "Redefinir a referência aceita o backend atual como nova referência. Os perfis de voz criados com o modelo anterior deixarão de ser sinalizados, e restaurar aquele backend não desfará isso. Reconstrua primeiro os perfis afetados. Continuar?",
+ "rebaselineConfirm": "Redefinir a referência aceita o backend atual e remove o aviso. Os perfis de voz do modelo anterior são mantidos e voltam a corresponder se esse backend for restaurado. Continuar?",
+ "samples": "Amostras",
+ "space": "Espaço",
+ "spacesTitle": "Espaços de voz (um por modelo de embeddings)",
"statusChanged": "Modelo alterado",
"statusOk": "Compatível",
"statusUnknown": "Não verificado",
+ "threshold": "Limite",
"title": "Compatibilidade das embeddings de voz"
},
"warning": "aviso",
@@ -1499,7 +1506,7 @@
"dismiss": "Dispensar",
"empty": "Nada requer sua atenção.",
"view": "Ver",
- "voiceEmbeddingChanged": "O serviço de transcrição está retornando embeddings de voz diferentes, portanto os perfis de voz existentes não corresponderão às novas gravações. Restaure o backend anterior, ou reconstrua os perfis e redefina a referência."
+ "voiceEmbeddingChanged": "O serviço de transcrição está retornando embeddings de voz de outro modelo. Os perfis de voz são mantidos separadamente para cada modelo: os do modelo anterior não corresponderão às novas gravações e voltam se você restaurar o backend anterior, e os do novo modelo são aprendidos conforme você nomeia os locutores."
},
"preferences": {
"description": "Preferências de exibição e comportamento do editor. Estas configurações ficam salvas em sua conta e se aplicam a todos os dispositivos.",
@@ -2109,6 +2116,22 @@
"uploadProgress": {
"title": "Progresso do Envio"
},
+ "voiceProfiles": {
+ "anotherModel": "outro modelo",
+ "auto": "atribuída automaticamente",
+ "confirmed": "confirmada",
+ "deletedRecording": "Gravação excluída",
+ "empty": "Nenhuma amostra de voz.",
+ "hint": "A correspondência de voz compara as novas gravações com estas amostras. Remova uma que pertença a outra pessoa.",
+ "legacy": "Perfil de voz anterior",
+ "legacyWeight": "peso {{count}}",
+ "manage": "Perfil de voz",
+ "otherModel": "{{count}} de outro modelo",
+ "remove": "Remover esta amostra",
+ "samples": "{{count}} amostra",
+ "samplesPlural": "{{count}} amostras",
+ "variantsPlural": "{{count}} variantes de voz"
+ },
"webhooks": {
"title": "Webhooks",
"subtitle": "Receba notificações HTTP quando gravações mudarem. Cada endpoint é assinado com HMAC-SHA256 para que receptores possam verificar a autenticidade.",
diff --git a/static/locales/ru.json b/static/locales/ru.json
index c9e3463c..0c891853 100644
--- a/static/locales/ru.json
+++ b/static/locales/ru.json
@@ -328,14 +328,21 @@
"viewFullPromptStructure": "Показать полную структуру запросов LLM",
"voiceEmbedding": {
"checkNow": "Проверить сейчас",
+ "current": "текущее",
"dimension": "Размерность",
"help": "Проверяет, что сервис расшифровки по-прежнему выдаёт голосовые эмбеддинги, совместимые с сохранёнными голосовыми профилями: отправляет короткий встроенный клип и сравнивает результат с эталоном. Выполняется при запуске; «Проверить сейчас» запускает повторно.",
"lastChecked": "Последняя проверка",
+ "lastSeen": "Последний раз",
+ "notCalibrated": "по умолчанию (пока мало образцов)",
"rebaseline": "Сбросить эталон",
- "rebaselineConfirm": "Сброс принимает текущий сервис как новый эталон. Профили, созданные прежней моделью, больше не будут помечаться, и восстановление того сервиса этого не отменит. Сначала перестройте затронутые профили. Продолжить?",
+ "rebaselineConfirm": "Новая привязка принимает текущий бэкенд за эталон и снимает предупреждение. Голосовые профили прежней модели сохраняются и снова начнут совпадать, если вернуть тот бэкенд. Продолжить?",
+ "samples": "Образцы",
+ "space": "Пространство",
+ "spacesTitle": "Голосовые пространства (по одному на модель эмбеддингов)",
"statusChanged": "Модель изменилась",
"statusOk": "Совместимо",
"statusUnknown": "Не проверялось",
+ "threshold": "Порог",
"title": "Совместимость голосовых эмбеддингов"
},
"warning": "предупреждение",
@@ -1499,7 +1506,7 @@
"dismiss": "Скрыть",
"empty": "Ничего не требует вашего внимания.",
"view": "Открыть",
- "voiceEmbeddingChanged": "Сервис расшифровки возвращает другие голосовые эмбеддинги, поэтому существующие голосовые профили не будут совпадать с новыми записями. Восстановите прежний сервис или перестройте профили и сбросьте эталон."
+ "voiceEmbeddingChanged": "Сервис транскрипции возвращает голосовые эмбеддинги другой модели. Голосовые профили хранятся отдельно для каждой модели: профили прежней модели не совпадут с новыми записями и вернутся, если восстановить прежний бэкенд, а профили новой модели формируются по мере того, как вы называете говорящих."
},
"preferences": {
"description": "Настройки отображения и поведения редактора. Эти параметры сохраняются в вашей учётной записи и применяются на всех устройствах.",
@@ -2109,6 +2116,22 @@
"uploadProgress": {
"title": "Прогресс загрузки"
},
+ "voiceProfiles": {
+ "anotherModel": "другая модель",
+ "auto": "назначено автоматически",
+ "confirmed": "подтверждено",
+ "deletedRecording": "Удалённая запись",
+ "empty": "Нет образцов голоса.",
+ "hint": "Сопоставление голоса сравнивает новые записи с этими образцами. Удалите образец, который принадлежит другому человеку.",
+ "legacy": "Прежний голосовой профиль",
+ "legacyWeight": "вес {{count}}",
+ "manage": "Голосовой профиль",
+ "otherModel": "Из другой модели: {{count}}",
+ "remove": "Удалить этот образец",
+ "samples": "Образцов: {{count}}",
+ "samplesPlural": "Образцов: {{count}}",
+ "variantsPlural": "Вариантов голоса: {{count}}"
+ },
"webhooks": {
"title": "Вебхуки",
"subtitle": "Получайте HTTP-уведомления при изменении записей. Каждая конечная точка подписывается HMAC-SHA256, чтобы получатели могли проверить подлинность.",
diff --git a/static/locales/zh.json b/static/locales/zh.json
index 473755fc..75205da7 100644
--- a/static/locales/zh.json
+++ b/static/locales/zh.json
@@ -328,14 +328,21 @@
"viewFullPromptStructure": "查看完整的 LLM 提示结构",
"voiceEmbedding": {
"checkNow": "立即检查",
+ "current": "当前",
"dimension": "维度",
"help": "通过发送一段内置的短音频并与参考值比较,检查转录服务返回的声纹特征是否仍与已保存的声纹档案兼容。启动时自动运行;点击“立即检查”可再次运行。",
"lastChecked": "上次检查",
+ "lastSeen": "最近出现",
+ "notCalibrated": "默认(样本尚不足)",
"rebaseline": "重置参考值",
- "rebaselineConfirm": "重置参考值会将当前后端作为新的参考。基于旧模型创建的声纹档案将不再被标记,恢复旧后端也无法撤销此操作。请先重建受影响的档案。是否继续?",
+ "rebaselineConfirm": "重新设定基准会将当前后端设为参考并清除警告。旧模型的声纹档案会保留,恢复该后端后即可再次匹配。是否继续?",
+ "samples": "样本",
+ "space": "空间",
+ "spacesTitle": "声纹空间(每个嵌入模型一个)",
"statusChanged": "模型已更改",
"statusOk": "兼容",
"statusUnknown": "未检查",
+ "threshold": "匹配阈值",
"title": "声纹特征兼容性"
},
"warning": "警告",
@@ -1499,7 +1506,7 @@
"dismiss": "忽略",
"empty": "暂无需要处理的事项。",
"view": "查看",
- "voiceEmbeddingChanged": "转录服务返回的声音特征已发生变化,现有的声纹档案将无法匹配新录音。请恢复之前的后端,或重建声纹档案并重置参考值。"
+ "voiceEmbeddingChanged": "转录服务返回的是另一个模型的声纹嵌入。声纹档案按模型分别保存:旧模型的档案不会匹配新录音,恢复先前的后端后即可重新使用;新模型的档案会在您为发言人命名时逐步建立。"
},
"preferences": {
"description": "显示与编辑器行为偏好。这些设置保存在您的账户中,并在所有设备上生效。",
@@ -2109,6 +2116,22 @@
"uploadProgress": {
"title": "上传进度"
},
+ "voiceProfiles": {
+ "anotherModel": "其他模型",
+ "auto": "自动标注",
+ "confirmed": "已确认",
+ "deletedRecording": "已删除的录音",
+ "empty": "没有声音样本。",
+ "hint": "声纹匹配会将新录音与这些样本比较。如果某个样本属于其他人,请将其删除。",
+ "legacy": "早期声纹档案",
+ "legacyWeight": "权重 {{count}}",
+ "manage": "声纹档案",
+ "otherModel": "{{count}} 个来自其他模型",
+ "remove": "删除此样本",
+ "samples": "{{count}} 个样本",
+ "samplesPlural": "{{count}} 个样本",
+ "variantsPlural": "{{count}} 种声音变体"
+ },
"webhooks": {
"title": "Webhook",
"subtitle": "在录音发生变化时接收 HTTP 通知。每个端点使用 HMAC-SHA256 签名,接收方可以验证真实性。",
diff --git a/templates/account.html b/templates/account.html
index 562f8f3e..a2b38610 100644
--- a/templates/account.html
+++ b/templates/account.html
@@ -3211,8 +3211,8 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
${hasVoiceProfile ? `
<div class="flex items-center justify-between gap-2 mb-2 px-2 py-1 bg-[var(--bg-secondary)] rounded">
<div class="flex items-center gap-1.5 min-w-0">
- <i class="fas fa-eraser text-[var(--text-accent)] text-[10px] flex-shrink-0"></i>
- <span class="text-[10px] text-[var(--text-muted)] truncate">${speaker.embedding_count} sample${speaker.embedding_count !== 1 ? 's' : ''}</span>
+ <i class="fas fa-wave-square text-[var(--text-accent)] text-[10px] flex-shrink-0"></i>
+ <span class="voice-summary-text text-[10px] text-[var(--text-muted)] truncate">${escapeHtml(voiceSummaryText(speaker))}</span>
</div>
${confidenceBadge}
</div>
@@ -3245,6 +3245,17 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
</div>
<div class="snippets-content"></div>
</div>
+
+ ${hasVoiceProfile ? `
+ <!-- Voice profile: the samples matching is built from -->
+ <button class="view-voice-samples-btn w-full mt-1 px-2 py-1 text-[10px] bg-[var(--bg-secondary)] hover:bg-[var(--bg-primary)] text-[var(--text-secondary)] rounded border border-[var(--border-secondary)] transition-colors"
+ data-speaker-id="${speaker.id}">
+ <i class="fas fa-wave-square mr-1"></i>
+ <span>${escapeHtml(vt('voiceProfiles.manage', 'Voice profile'))}</span>
+ <i class="fas fa-chevron-down ml-1 transition-transform duration-200"></i>
+ </button>
+ <div class="voice-samples-container mt-2 hidden"></div>
+ ` : ''}
</div>
`;
@@ -3261,6 +3272,12 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
const snippetsContainer = speakerCard.querySelector('.snippets-container');
viewSnippetsBtn.addEventListener('click', () => toggleSpeakerSnippets(speaker.id, viewSnippetsBtn, snippetsContainer));
+ const voiceBtn = speakerCard.querySelector('.view-voice-samples-btn');
+ if (voiceBtn) {
+ const voiceContainer = speakerCard.querySelector('.voice-samples-container');
+ voiceBtn.addEventListener('click', () => toggleVoiceSamples(speaker, voiceBtn, voiceContainer, speakerCard));
+ }
+
speakersTabGrid.appendChild(speakerCard);
});
@@ -3330,6 +3347,131 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co
}
// Toggle speaker snippets
+ // ---- Voice profile samples ------------------------------------
+ function vt(key, fallback, params) {
+ if (window.i18n) {
+ const value = window.i18n.t(key, params || {});
+ if (value && value !== key) return value;
+ }
+ return fallback;
+ }
+
+ function voiceSummaryText(speaker) {
+ const v = speaker.voice || {};
+ const samples = v.current_space_samples != null ? v.current_space_samples : (speaker.embedding_count || 0);
+ const variants = v.variant_count || (samples ? 1 : 0);
+ let text = vt(samples === 1 ? 'voiceProfiles.samples' : 'voiceProfiles.samplesPlural',
+ `${samples} sample${samples === 1 ? '' : 's'}`, { count: samples });
+ if (variants > 1) {
+ text += ' · ' + vt('voiceProfiles.variantsPlural', `${variants} voice variants`, { count: variants });
+ }
+ if (v.other_space_samples) {
+ text += ' · ' + vt('voiceProfiles.otherModel', `${v.other_space_samples} from another model`, { count: v.other_space_samples });
+ }
+ return text;
+ }
+
+ function formatSeconds(sec) {
+ if (sec == null) return '';
+ const m = Math.floor(sec / 60), s = Math.round(sec % 60);
+ return `${m}:${String(s).padStart(2, '0')}`;
+ }
+
+ async function toggleVoiceSamples(speaker, button, container, card) {
+ const chevron = button.querySelector('.fa-chevron-down');
+ if (!container.classList.contains('hidden')) {
+ container.classList.add('hidden');
+ chevron.classList.remove('rotate-180');
+ return;
+ }
+ container.classList.remove('hidden');
+ chevron.classList.add('rotate-180');
+ await renderVoiceSamples(speaker, container, card);
+ }
+
+ async function renderVoiceSamples(speaker, container, card) {
+ container.innerHTML = '<div class="text-center py-3"><i class="fas fa-spinner fa-spin text-[var(--text-muted)] text-xs"></i></div>';
+ try {
+ const response = await fetch(`/speakers/${speaker.id}/voice_samples`);
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
+ const data = await response.json();
+ const samples = data.samples || [];
+ container.innerHTML = '';
+ const hint = document.createElement('p');
+ hint.className = 'text-[10px] text-[var(--text-muted)] mb-1';
+ hint.textContent = vt('voiceProfiles.hint', 'Voice matching compares new recordings with these samples. Remove one that belongs to someone else.');
+ container.appendChild(hint);
+ if (!samples.length) {
+ const empty = document.createElement('p');
+ empty.className = 'text-[10px] text-[var(--text-muted)] italic';
+ empty.textContent = vt('voiceProfiles.empty', 'No voice samples.');
+ container.appendChild(empty);
+ return;
+ }
+ samples.forEach(sample => {
+ const row = document.createElement('div');
+ row.className = 'flex items-center gap-2 py-1 border-t border-[var(--border-primary)] text-[10px]';
+ const info = document.createElement('div');
+ info.className = 'flex-1 min-w-0';
+ const title = document.createElement(sample.recording_id ? 'a' : 'span');
+ title.className = 'block truncate text-[var(--text-secondary)]' + (sample.recording_id ? ' hover:text-[var(--text-accent)]' : '');
+ if (sample.recording_id) title.href = `/recordings/${sample.recording_id}`;
+ title.textContent = sample.source === 'legacy'
+ ? vt('voiceProfiles.legacy', 'Earlier voice profile')
+ : (sample.recording_title || vt('voiceProfiles.deletedRecording', 'Deleted recording'));
+ const meta = document.createElement('span');
+ meta.className = 'block truncate text-[var(--text-muted)]';
+ const parts = [];
+ if (sample.label) parts.push(sample.label);
+ if (sample.speech_seconds != null) parts.push(formatSeconds(sample.speech_seconds));
+ parts.push(sample.source === 'auto' ? vt('voiceProfiles.auto', 'auto-labelled')
+ : sample.source === 'legacy' ? vt('voiceProfiles.legacyWeight', `weight ${sample.weight}`, { count: sample.weight })
+ : vt('voiceProfiles.confirmed', 'confirmed'));
+ if (!sample.in_current_space) parts.push(vt('voiceProfiles.anotherModel', 'another model'));
+ meta.textContent = parts.join(' · ');
+ info.appendChild(title);
+ info.appendChild(meta);
+ const remove = document.createElement('button');
+ remove.className = 'p-1 text-[var(--text-muted)] hover:text-[var(--text-danger)] rounded flex-shrink-0';
+ remove.title = vt('voiceProfiles.remove', 'Remove this sample');
+ remove.setAttribute('aria-label', remove.title);
+ remove.innerHTML = '<i class="fas fa-times"></i>';
+ remove.addEventListener('click', async () => {
+ remove.disabled = true;
+ try {
+ const csrf = document.querySelector('meta[name=csrf-token]')?.getAttribute('content');
+ // The pre-sample profile has no row of its own: removing it
+ // clears the profile.
+ const r = sample.id == null
+ ? await fetch(`/speakers/${speaker.id}/clear_embeddings`, {
+ method: 'POST', headers: csrf ? { 'X-CSRFToken': csrf } : {} })
+ : await fetch(`/speakers/${speaker.id}/voice_samples/${sample.id}`, {
+ method: 'DELETE', headers: csrf ? { 'X-CSRFToken': csrf } : {} });
+ const body = await r.json();
+ if (!r.ok) throw new Error(body.error || `HTTP ${r.status}`);
+ const voice = body.summary || { sample_count: 0, current_space_samples: 0, variant_count: 0, other_space_samples: 0 };
+ Object.assign(speaker, body.speaker || {}, { voice });
+ const summaryEl = card.querySelector('.voice-summary-text');
+ if (summaryEl) summaryEl.textContent = voiceSummaryText(speaker);
+ await renderVoiceSamples(speaker, container, card);
+ } catch (error) {
+ remove.disabled = false;
+ showToast(error.message, 'error');
+ }
+ });
+ row.appendChild(info);
+ row.appendChild(remove);
+ container.appendChild(row);
+ });
+ } catch (error) {
+ container.innerHTML = '';
+ const err = document.createElement('p');
+ err.className = 'text-[10px] text-[var(--text-danger)]';
+ err.textContent = error.message;
+ container.appendChild(err);
+ }
+ }
+
async function toggleSpeakerSnippets(speakerId, button, container) {
const isExpanded = !container.classList.contains('hidden');
const chevron = button.querySelector('.fa-chevron-down');
diff --git a/templates/admin.html b/templates/admin.html
index dee7b29b..eeb41d2c 100644
--- a/templates/admin.html
+++ b/templates/admin.html
@@ -451,6 +451,35 @@
</div>
<!-- Diagnostic string from the checker, shown as-is like a log line. -->
<p v-if="voiceEmbedding.detail" class="text-xs text-[var(--text-muted)] mb-3 font-mono break-words" v-text="voiceEmbedding.detail"></p>
+ <!-- Voice spaces: one per embedding model seen. Profiles are only
+ compared within their space, so switching back to a previous
+ backend brings its profiles back. -->
+ <div v-if="voiceEmbedding.spaces && voiceEmbedding.spaces.length" class="mb-3">
+ <div class="text-xs font-medium text-[var(--text-secondary)] mb-1" v-text="t('adminDashboard.voiceEmbedding.spacesTitle')"></div>
+ <table class="w-full text-xs">
+ <thead>
+ <tr class="text-left text-[var(--text-muted)]">
+ <th class="py-1 pr-2 font-normal" v-text="t('adminDashboard.voiceEmbedding.space')"></th>
+ <th class="py-1 pr-2 font-normal" v-text="t('adminDashboard.voiceEmbedding.dimension')"></th>
+ <th class="py-1 pr-2 font-normal" v-text="t('adminDashboard.voiceEmbedding.samples')"></th>
+ <th class="py-1 pr-2 font-normal" v-text="t('adminDashboard.voiceEmbedding.threshold')"></th>
+ <th class="py-1 font-normal" v-text="t('adminDashboard.voiceEmbedding.lastSeen')"></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr v-for="space in voiceEmbedding.spaces" :key="space.id" class="border-t border-[var(--border-primary)]">
+ <td class="py-1 pr-2">
+ #${ space.id }
+ <span v-if="space.current" class="ml-1 px-1.5 rounded bg-[var(--bg-success)] text-[var(--text-success-strong)]" v-text="t('adminDashboard.voiceEmbedding.current')"></span>
+ </td>
+ <td class="py-1 pr-2">${ space.dimension || '' }</td>
+ <td class="py-1 pr-2">${ space.sample_count }</td>
+ <td class="py-1 pr-2" v-text="space.calibrated_threshold != null ? space.calibrated_threshold : t('adminDashboard.voiceEmbedding.notCalibrated')"></td>
+ <td class="py-1" v-text="space.last_seen_at ? formatDate(space.last_seen_at) : ''"></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
<div class="flex flex-wrap gap-2">
<button @click="checkVoiceEmbedding" :disabled="voiceEmbeddingBusy" class="btn btn--sm btn--ghost">
<i class="fas fa-sync-alt mr-1" :class="{ 'fa-spin': voiceEmbeddingBusy }"></i>${t('adminDashboard.voiceEmbedding.checkNow')}