Run pyannote diarization in background thread with progress reporting

Move the blocking pipeline() call to a daemon thread and emit estimated
progress messages every 2 seconds from the main thread. The progress
estimate uses audio duration to calibrate the expected total time.
Also pass audio_duration_sec from PipelineService to DiarizeService.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-20 13:50:57 -07:00
parent d00281f0c7
commit 03af5a189c
3 changed files with 110 additions and 2 deletions

View File

@@ -121,6 +121,7 @@ class PipelineService:
num_speakers=num_speakers,
min_speakers=min_speakers,
max_speakers=max_speakers,
audio_duration_sec=transcription.duration_ms / 1000.0,
)
# Step 3: Merge