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:
@@ -35,6 +35,7 @@ class ServeClientFasterWhisper(ServeClientBase):
|
||||
cache_path="~/.cache/whisper-live/",
|
||||
translation_queue=None,
|
||||
hotwords=None,
|
||||
diarization=None,
|
||||
):
|
||||
"""
|
||||
Initialize a ServeClient instance.
|
||||
@@ -64,7 +65,8 @@ class ServeClientFasterWhisper(ServeClientBase):
|
||||
no_speech_thresh,
|
||||
clip_audio,
|
||||
same_output_threshold,
|
||||
translation_queue
|
||||
translation_queue,
|
||||
diarization,
|
||||
)
|
||||
self.cache_path = cache_path
|
||||
self.model_sizes = [
|
||||
|
||||
Reference in New Issue
Block a user