Skip to content

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

Python

Speaker dialog: "Identify from conversation" (#403)

Murtaza Nasir948289912af4
diff --git a/docs/user-guide/transcripts.md b/docs/user-guide/transcripts.md
index 265741cf..f1bb1c78 100644
--- a/docs/user-guide/transcripts.md
+++ b/docs/user-guide/transcripts.md
@@ -22,6 +22,8 @@ When you need to assign real names to speaker labels, click the speaker identifi
The speaker identification modal shows each detected speaker with a sample of their dialogue to help you identify them. When you've identified speakers in previous recordings, Speakr's voice recognition system analyzes voice embeddings and provides intelligent suggestions with confidence scores. You can enter real names for each speaker, and these names will replace the generic labels throughout the transcription. The system remembers these assignments and builds voice profiles, making it easier and faster to identify the same speakers in subsequent recordings.
+**Identify from conversation** works differently: it asks the text model to find names mentioned in the conversation, for example when people introduce or address each other, and fills them in for you to review. By default it names only the speakers that are still unnamed; **Re-identify all from conversation** in its menu starts again for every speaker. It needs a text model and does not use voice profiles, so voice matches appear as suggestions whether or not you use it. Without a configured text model the button is disabled.
+
### Managing Saved Speakers
All speakers you identify are automatically saved to your speaker database. You can manage these saved speakers through the dedicated [Speakers Management tab](settings.md#speakers-management-tab) in your [account settings](settings.md). Navigate to Account > Speakers Management to view all your saved speakers.
diff --git a/src/api/recordings.py b/src/api/recordings.py
index ac895a88..263aa209 100644
--- a/src/api/recordings.py
+++ b/src/api/recordings.py
@@ -1286,6 +1286,11 @@ def reset_status(recording_id):
# --- Authentication Routes ---
+def _text_model_configured():
+ from src.services.llm import TEXT_MODEL_CONFIGURED
+ return TEXT_MODEL_CONFIGURED
+
+
@recordings_bp.route('/')
@recordings_bp.route('/recordings/<int:recording_id>')
@recordings_bp.route('/label/<label_name>')
@@ -1384,7 +1389,8 @@ def index(recording_id=None, label_name=None):
server_recording_chunks_enabled=server_recording_chunks_enabled,
recording_max_hours=recording_max_hours,
recording_chunk_seconds=recording_chunk_seconds,
- recording_video_kbps=recording_video_kbps)
+ recording_video_kbps=recording_video_kbps,
+ text_model_configured=_text_model_configured())
diff --git a/static/locales/de.json b/static/locales/de.json
index 70afd143..f5f29c62 100644
--- a/static/locales/de.json
+++ b/static/locales/de.json
@@ -1199,8 +1199,8 @@
"audioDeletedMessage": "Die Audiodatei wurde entfernt. Transkript, Zusammenfassung und Notizen bleiben verfügbar.",
"audioDeletedTitle": "Audiodatei gelöscht",
"audioPlayer": "Audio-Player",
- "autoIdentify": "Automatisch identifizieren",
- "autoIdentifyMobile": "Auto",
+ "autoIdentify": "Aus dem Gespräch erkennen",
+ "autoIdentifyMobile": "Aus Kontext",
"bothAudioDesc": "Nimmt Ihre Stimme + Meeting-Teilnehmer auf (empfohlen für Online-Meetings)",
"clearFilters": "Filter löschen",
"clickToAddNotes": "Klicken um Notizen hinzuzufügen...",
@@ -1230,7 +1230,7 @@
"generatingSummary": "Generiere Zusammenfassung...",
"groups": "Gruppen",
"howToRecordSystemAudio": "Wie man System-Audio aufnimmt",
- "identifyAllSpeakers": "Alle Sprecher identifizieren",
+ "identifyAllSpeakers": "Alle aus dem Gespräch neu erkennen",
"identifying": "Identifiziere...",
"importantNote": "Wichtiger Hinweis",
"internalSharingDesc": "Mit bestimmten Benutzern in Ihrer Organisation teilen",
@@ -1301,7 +1301,9 @@
"whyNotWorking": "Warum funktioniert es nicht?",
"youHaveXSpeakers": "Sie haben {{count}} Sprecher, aber nur 16 eindeutige Farben sind verfügbar. Die Farben wiederholen sich nach dem 16. Sprecher.",
"createTagNamed": "Tag \"{{name}}\" erstellen",
- "newTag": "Neues Tag"
+ "newTag": "Neues Tag",
+ "autoIdentifyTooltip": "Liest im Gespräch genannte Namen. Stimmtreffer erscheinen auch ohne dies als Vorschläge.",
+ "autoIdentifyNoModel": "Benötigt ein Textmodell, und keines ist eingerichtet. Stimmtreffer erscheinen auch ohne als Vorschläge."
},
"incognito": {
"audioNotStored": "Audio wird im Inkognito-Modus nicht gespeichert",
diff --git a/static/locales/en.json b/static/locales/en.json
index f76cc862..b566a6a1 100644
--- a/static/locales/en.json
+++ b/static/locales/en.json
@@ -1199,8 +1199,8 @@
"audioDeletedMessage": "The audio file was removed. The transcript, summary and notes remain available.",
"audioDeletedTitle": "Audio file deleted",
"audioPlayer": "Audio Player",
- "autoIdentify": "Auto Identify",
- "autoIdentifyMobile": "Auto",
+ "autoIdentify": "Identify from conversation",
+ "autoIdentifyMobile": "From context",
"bothAudioDesc": "Records your voice + meeting participants (recommended for online meetings)",
"clearFilters": "clear filters",
"clickToAddNotes": "Click to add notes...",
@@ -1230,7 +1230,7 @@
"generatingSummary": "Generating summary...",
"groups": "groups",
"howToRecordSystemAudio": "How to Record System Audio",
- "identifyAllSpeakers": "Identify all speakers",
+ "identifyAllSpeakers": "Re-identify all from conversation",
"identifying": "Identifying...",
"importantNote": "Important note",
"internalSharingDesc": "Share with specific users in your organization",
@@ -1301,7 +1301,9 @@
"whyNotWorking": "Why isn't it working?",
"youHaveXSpeakers": "You have {{count}} speakers, but only 16 unique colors are available. Colors will repeat after the 16th speaker.",
"createTagNamed": "Create tag \"{{name}}\"",
- "newTag": "New tag"
+ "newTag": "New tag",
+ "autoIdentifyTooltip": "Reads names mentioned in the conversation. Voice matches appear as suggestions without this.",
+ "autoIdentifyNoModel": "Needs a text model, and none is configured. Voice matches appear as suggestions without it."
},
"incognito": {
"audioNotStored": "Audio not stored in incognito mode",
diff --git a/static/locales/es.json b/static/locales/es.json
index bae839bc..fe43ddec 100644
--- a/static/locales/es.json
+++ b/static/locales/es.json
@@ -1199,8 +1199,8 @@
"audioDeletedMessage": "El archivo de audio se eliminó. La transcripción, el resumen y las notas siguen disponibles.",
"audioDeletedTitle": "Archivo de audio eliminado",
"audioPlayer": "Reproductor de Audio",
- "autoIdentify": "Identificar Automáticamente",
- "autoIdentifyMobile": "Auto",
+ "autoIdentify": "Identificar por la conversación",
+ "autoIdentifyMobile": "Por contexto",
"bothAudioDesc": "Graba tu voz + participantes de reunión (recomendado para reuniones en línea)",
"clearFilters": "limpiar filtros",
"clickToAddNotes": "Haz clic para añadir notas...",
@@ -1230,7 +1230,7 @@
"generatingSummary": "Generando resumen...",
"groups": "grupos",
"howToRecordSystemAudio": "Cómo Grabar Audio del Sistema",
- "identifyAllSpeakers": "Identificar todos los hablantes",
+ "identifyAllSpeakers": "Reidentificar todos por la conversación",
"identifying": "Identificando...",
"importantNote": "Nota importante",
"internalSharingDesc": "Compartir con usuarios específicos de su organización",
@@ -1301,7 +1301,9 @@
"whyNotWorking": "¿Por qué no funciona?",
"youHaveXSpeakers": "Tiene {{count}} oradores, pero solo hay 16 colores únicos disponibles. Los colores se repetirán después del decimosexto orador.",
"createTagNamed": "Crear etiqueta \"{{name}}\"",
- "newTag": "Nueva etiqueta"
+ "newTag": "Nueva etiqueta",
+ "autoIdentifyTooltip": "Lee los nombres mencionados en la conversación. Las coincidencias de voz aparecen como sugerencias sin esto.",
+ "autoIdentifyNoModel": "Necesita un modelo de texto, y no hay ninguno configurado. Las coincidencias de voz aparecen como sugerencias sin él."
},
"incognito": {
"audioNotStored": "El audio no se almacena en modo incógnito",
diff --git a/static/locales/fr.json b/static/locales/fr.json
index 2e6a8bef..715943ca 100644
--- a/static/locales/fr.json
+++ b/static/locales/fr.json
@@ -1199,8 +1199,8 @@
"audioDeletedMessage": "Le fichier audio a été supprimé. La transcription, le résumé et les notes restent disponibles.",
"audioDeletedTitle": "Fichier audio supprimé",
"audioPlayer": "Lecteur Audio",
- "autoIdentify": "Identifier Automatiquement",
- "autoIdentifyMobile": "Auto",
+ "autoIdentify": "Identifier d'après la conversation",
+ "autoIdentifyMobile": "Par contexte",
"bothAudioDesc": "Enregistre votre voix + les participants à la réunion (recommandé pour les réunions en ligne)",
"clearFilters": "effacer les filtres",
"clickToAddNotes": "Cliquez pour ajouter des notes...",
@@ -1230,7 +1230,7 @@
"generatingSummary": "Génération du résumé...",
"groups": "groupes",
"howToRecordSystemAudio": "Comment Enregistrer l'Audio Système",
- "identifyAllSpeakers": "Identifier tous les orateurs",
+ "identifyAllSpeakers": "Tout réidentifier d'après la conversation",
"identifying": "Identification...",
"importantNote": "Note importante",
"internalSharingDesc": "Partager avec des utilisateurs spécifiques de votre organisation",
@@ -1301,7 +1301,9 @@
"whyNotWorking": "Pourquoi ça ne marche pas?",
"youHaveXSpeakers": "Vous avez {{count}} locuteurs, mais seulement 16 couleurs uniques sont disponibles. Les couleurs se répéteront après le 16ème locuteur.",
"createTagNamed": "Créer le tag \"{{name}}\"",
- "newTag": "Nouveau tag"
+ "newTag": "Nouveau tag",
+ "autoIdentifyTooltip": "Lit les noms mentionnés dans la conversation. Les correspondances vocales apparaissent comme suggestions sans cela.",
+ "autoIdentifyNoModel": "Nécessite un modèle de texte, et aucun n'est configuré. Les correspondances vocales apparaissent comme suggestions sans lui."
},
"incognito": {
"audioNotStored": "Audio non stocké en mode incognito",
diff --git a/static/locales/pt-BR.json b/static/locales/pt-BR.json
index a50894ea..fd1e8808 100644
--- a/static/locales/pt-BR.json
+++ b/static/locales/pt-BR.json
@@ -1199,8 +1199,8 @@
"audioDeletedMessage": "O arquivo de áudio foi removido. A transcrição, o resumo e as notas continuam disponíveis.",
"audioDeletedTitle": "Arquivo de áudio deletado",
"audioPlayer": "Reprodutor de Áudio",
- "autoIdentify": "Identificar Automaticamente",
- "autoIdentifyMobile": "Auto",
+ "autoIdentify": "Identificar pela conversa",
+ "autoIdentifyMobile": "Pelo contexto",
"bothAudioDesc": "Grava sua voz + áudio dos participantes da reunião (recomendado para reuniões online)",
"clearFilters": "limpar filtros",
"clickToAddNotes": "Clique para adicionar notas...",
@@ -1230,7 +1230,7 @@
"generatingSummary": "Gerando resumo...",
"groups": "grupos",
"howToRecordSystemAudio": "Como Gravar Áudio do Sistema",
- "identifyAllSpeakers": "Identificar todos os oradores",
+ "identifyAllSpeakers": "Reidentificar todos pela conversa",
"identifying": "Identificando...",
"importantNote": "Nota importante",
"internalSharingDesc": "Compartilhe com usuários específicos em sua organização",
@@ -1301,7 +1301,9 @@
"whyNotWorking": "Por que não está funcionando?",
"youHaveXSpeakers": "Você tem {{count}} oradores, mas apenas 16 cores únicas estão disponíveis. As cores se repetirão após o 16º orador.",
"createTagNamed": "Criar tag \"{{name}}\"",
- "newTag": "Nova tag"
+ "newTag": "Nova tag",
+ "autoIdentifyTooltip": "Lê os nomes mencionados na conversa. As correspondências de voz aparecem como sugestões sem isso.",
+ "autoIdentifyNoModel": "Precisa de um modelo de texto, e nenhum está configurado. As correspondências de voz aparecem como sugestões sem ele."
},
"incognito": {
"audioNotStored": "Áudio não armazenado em modo incógnito",
diff --git a/static/locales/ru.json b/static/locales/ru.json
index 668358ca..b8981441 100644
--- a/static/locales/ru.json
+++ b/static/locales/ru.json
@@ -1199,8 +1199,8 @@
"audioDeletedMessage": "Аудиофайл удалён. Транскрипт, резюме и заметки по-прежнему доступны.",
"audioDeletedTitle": "Аудиофайл удалён",
"audioPlayer": "Аудиоплеер",
- "autoIdentify": "Автоопределение",
- "autoIdentifyMobile": "Авто",
+ "autoIdentify": "Определить по разговору",
+ "autoIdentifyMobile": "По контексту",
"bothAudioDesc": "Записывает ваш голос + участников встречи (рекомендуется для онлайн-встреч)",
"clearFilters": "сбросить фильтры",
"clickToAddNotes": "Нажмите, чтобы добавить заметки...",
@@ -1230,7 +1230,7 @@
"generatingSummary": "Генерация резюме...",
"groups": "группы",
"howToRecordSystemAudio": "Как записать системный звук",
- "identifyAllSpeakers": "Определить всех спикеров",
+ "identifyAllSpeakers": "Заново определить всех по разговору",
"identifying": "Определение...",
"importantNote": "Важное примечание",
"internalSharingDesc": "Поделиться с конкретными пользователями в вашей организации",
@@ -1301,7 +1301,9 @@
"whyNotWorking": "Почему не работает?",
"youHaveXSpeakers": "У вас {{count}} спикеров, но доступно только 16 уникальных цветов. Цвета будут повторяться после 16-го спикера.",
"createTagNamed": "Создать тег \"{{name}}\"",
- "newTag": "Новый тег"
+ "newTag": "Новый тег",
+ "autoIdentifyTooltip": "Ищет имена, упомянутые в разговоре. Совпадения по голосу появляются как подсказки и без этого.",
+ "autoIdentifyNoModel": "Нужна текстовая модель, а она не настроена. Совпадения по голосу появляются как подсказки и без неё."
},
"incognito": {
"audioNotStored": "Аудио не сохраняется в режиме инкогнито",
diff --git a/static/locales/zh.json b/static/locales/zh.json
index afac7501..da3463f3 100644
--- a/static/locales/zh.json
+++ b/static/locales/zh.json
@@ -1199,8 +1199,8 @@
"audioDeletedMessage": "音频文件已删除。转录文本、摘要和笔记仍可查看。",
"audioDeletedTitle": "音频文件已删除",
"audioPlayer": "音频播放器",
- "autoIdentify": "自动识别",
- "autoIdentifyMobile": "自动",
+ "autoIdentify": "从对话中识别",
+ "autoIdentifyMobile": "从上下文",
"bothAudioDesc": "录制您的声音 + 会议参与者(推荐用于在线会议)",
"clearFilters": "清除筛选",
"clickToAddNotes": "点击添加笔记...",
@@ -1230,7 +1230,7 @@
"generatingSummary": "生成摘要中...",
"groups": "组",
"howToRecordSystemAudio": "如何录制系统音频",
- "identifyAllSpeakers": "识别所有发言人",
+ "identifyAllSpeakers": "从对话中重新识别全部",
"identifying": "识别中...",
"importantNote": "重要提示",
"internalSharingDesc": "与您组织中的特定用户分享",
@@ -1301,7 +1301,9 @@
"whyNotWorking": "为什么不工作?",
"youHaveXSpeakers": "您有 {{count}} 位发言人,但只有16种独特的颜色可用。颜色将在第16位发言人之后重复。",
"createTagNamed": "创建标签\"{{name}}\"",
- "newTag": "新建标签"
+ "newTag": "新建标签",
+ "autoIdentifyTooltip": "读取对话中提到的名字。声纹匹配无需此功能也会显示为建议。",
+ "autoIdentifyNoModel": "需要文本模型,但尚未配置。声纹匹配无需它也会显示为建议。"
},
"incognito": {
"audioNotStored": "隐身模式下不会保存音频",
diff --git a/templates/modals/speaker-modal.html b/templates/modals/speaker-modal.html
index ba1095a4..6abd1929 100644
--- a/templates/modals/speaker-modal.html
+++ b/templates/modals/speaker-modal.html
@@ -336,10 +336,14 @@
<div class="modal-footer modal-footer--between flex-wrap gap-y-2">
<div class="flex items-center gap-2">
<div class="relative inline-flex" ref="autoIdSplitBtn">
+ <!-- Identifies speakers from names mentioned in the conversation,
+ with the text model. It predates voice profiles: voice
+ matches already appear as suggestions without it (#403). -->
<button @click="autoIdentifySpeakers(false)"
class="btn btn--primary"
style="border-top-right-radius: 0; border-bottom-right-radius: 0;"
- :disabled="isAutoIdentifying">
+ :disabled="isAutoIdentifying || {{ 'false' if text_model_configured else 'true' }}"
+ :title="{{ 'true' if text_model_configured else 'false' }} ? t('help.autoIdentifyTooltip') : t('help.autoIdentifyNoModel')">
<i class="fas fa-magic"></i>
<span v-if="!isAutoIdentifying" class="hidden sm:inline" v-text="t('help.autoIdentify')"></span>
<span v-if="!isAutoIdentifying" class="sm:hidden" v-text="t('help.autoIdentifyMobile')"></span>
@@ -348,7 +352,7 @@
<button @click="showAutoIdDropdown = !showAutoIdDropdown"
class="btn btn--primary btn--icon"
style="border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,0.2);"
- :disabled="isAutoIdentifying"
+ :disabled="isAutoIdentifying || {{ 'false' if text_model_configured else 'true' }}"
:aria-label="t('help.identifyAllSpeakers')">
<i class="fas fa-caret-down"></i>
</button>
diff --git a/tests/test_keyless_llm.py b/tests/test_keyless_llm.py
index 6c3be734..9aab9683 100644
--- a/tests/test_keyless_llm.py
+++ b/tests/test_keyless_llm.py
@@ -113,3 +113,29 @@ def test_without_a_model_the_call_says_so(monkeypatch):
monkeypatch.setattr(llm, "client", None)
with pytest.raises(ValueError, match="No text model is configured"):
llm.call_llm_completion([{"role": "user", "content": "hi"}])
+
+
[email protected]('configured,expected', [(True, 'isAutoIdentifying || false'), (False, 'isAutoIdentifying || true')])
+def test_identify_from_conversation_is_disabled_without_a_model(monkeypatch, configured, expected):
+ """The button reads names from the conversation with the text model; voice
+ matches need no model and appear as suggestions anyway."""
+ import secrets
+ from src.app import app, db
+ from src.models import User
+ monkeypatch.setattr(llm, 'TEXT_MODEL_CONFIGURED', configured)
+ app.config['WTF_CSRF_ENABLED'] = False
+ with app.app_context():
+ s = secrets.token_hex(4)
+ u = User(username=f'idb_{s}', email=f'idb_{s}@local.test', password='x')
+ db.session.add(u)
+ db.session.commit()
+ try:
+ client = app.test_client()
+ with client.session_transaction() as sess:
+ sess['_user_id'] = str(u.id)
+ page = client.get('/')
+ assert page.status_code == 200
+ assert expected in page.get_data(as_text=True)
+ finally:
+ db.session.delete(u)
+ db.session.commit()