Stream Whisper segments so the UI can show live transcript text.

Consume faster-whisper SSE instead of blocking on one JSON response, persist growing text and progress over Reverb, and drop the fake percent heartbeat.
This commit is contained in:
ben
2026-08-13 12:34:47 +02:00
parent 5cea5192c2
commit 4c73620458
9 changed files with 574 additions and 138 deletions
+9 -3
View File
@@ -502,14 +502,20 @@ class Recording extends Model
/**
* Update the live progress fields shown in the UI.
*/
public function reportProgress(string $message, int $percent, string $status = 'processing'): void
public function reportProgress(string $message, int $percent, string $status = 'processing', ?string $partialTranscript = null): void
{
$this->forceFill([
$attributes = [
'transcription_status' => $status,
'transcription_progress' => $message,
'transcription_percent' => max(0, min(100, $percent)),
'transcription_error' => null,
])->save();
];
if ($partialTranscript !== null) {
$attributes['transcript'] = $partialTranscript;
}
$this->forceFill($attributes)->save();
RecordingTranscriptionUpdated::dispatch($this->fresh());
}