TsgcAIOpenAIChatBotProperties › AudioRecorder

AudioRecorder Property

Component used to capture microphone audio that is sent to Whisper for transcription.

Syntax

property AudioRecorder: TsgcAudioRecorder read FAudioRecorder write SetAudioRecorder;

Default Value

Remarks

Assign a TsgcAudioRecorder descendant such as TsgcAudioRecorderMCI. The ChatBot hooks OnStart, OnStop and OnAudio: when Stop finishes, the recorded file in RecorderOptions.Filename is uploaded to the Whisper API and, once transcribed, deleted from disk. Setting RecorderOptions.Mode to camoAuto makes the ChatBot auto-restart recording after the TTS reply completes, enabling a hands-free conversation loop.

Example

sgcAudioRecorder := TsgcAudioRecorderMCI.Create(Self);
sgcChatBot.AudioRecorder := sgcAudioRecorder;

Back to Properties