From 1f684cdd97f3becf68283d8f09ba8c499ddfc4f2 Mon Sep 17 00:00:00 2001 From: Quentin Fuxa Date: Mon, 6 Oct 2025 19:53:27 +0200 Subject: [PATCH] fixes #251 --- whisperlivekit/audio_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whisperlivekit/audio_processor.py b/whisperlivekit/audio_processor.py index 2227590..4a175cf 100644 --- a/whisperlivekit/audio_processor.py +++ b/whisperlivekit/audio_processor.py @@ -335,10 +335,10 @@ class AudioProcessor: # Process diarization await diarization_obj.diarize(pcm_array) - segments = diarization_obj.get_segments() if self.diarization_before_transcription: + segments = diarization_obj.get_segments() self.cumulative_pcm.append(pcm_array) - if self.segments: + if segments: last_segment = segments[-1] if last_segment.speaker != self.current_speaker: cut_sec = last_segment.start - self.last_end