TsgcAIOpenAITranslator › Events › OnAudioStop
Fires when the audio recorder has finished capturing, right before the file is sent to the Whisper API.
property OnAudioStop: TsgcOpenAIAudioStop;
// TsgcOpenAIAudioStop = procedure(Sender: TObject) of object
—
Triggered when the recorder's own stop notification fires — either after an explicit call to Stop or when the recorder detects end-of-speech in automatic mode. It is a convenient place to show a "translating..." indicator while the HTTP request to the Whisper endpoint is still in flight; the actual translated text is delivered shortly afterwards through OnTranslation. Because the upload to OpenAI is synchronous inside the pipeline, avoid blocking the UI from this handler.
procedure TForm1.sgcTranslatorAudioStop(Sender: TObject);
begin
StatusBar1.SimpleText := 'Translating...';
end;