Add real-time speaker diarization support
- New whisper_live/diarization.py: SpeakerDiarizer with online clustering - Uses pyannote.audio speaker embeddings (optional dependency) - Cosine similarity threshold for speaker matching (default 0.55) - Running average embedding update for speaker stability - Configurable max_speakers limit (default 10) - Client options: enable_diarization, max_speakers - Segments include 'speaker' field when diarization is active - Graceful fallback: logs warning if pyannote not installed - Added 12 unit tests (mock-based, no GPU required)
This commit is contained in:
@@ -56,6 +56,8 @@ class TestClientCallbacks(BaseTestCase):
|
||||
"enable_translation": False,
|
||||
"target_language": "fr",
|
||||
"hotwords": None,
|
||||
"enable_diarization": False,
|
||||
"max_speakers": 10,
|
||||
})
|
||||
self.client.on_open(self.mock_ws_app)
|
||||
self.mock_ws_app.send.assert_called_with(expected_message)
|
||||
|
||||
Reference in New Issue
Block a user