AI Translator

Translate text between languages using AI models. Supports multiple LLM backends including OpenAI, Anthropic, and local models.

TsgcAIOpenAITranslator

Speech-in, speech-out translator. Captures audio, sends it to Whisper translation, speaks the English result through a TTS provider.

Component class

TsgcAIOpenAITranslator

Protocol

Voice front-end on top of OpenAI Whisper translation

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Enterprise (AI add-on)

Drop the component, set a few properties, go

Plug an AudioRecorder + TextToSpeech, set the API key, call Start to capture and Stop to translate.

uses
  sgcAI, sgcAI_OpenAI, sgcAI_OpenAI_Audio_Translator,
  sgcAI_AudioRecorder_MCI, sgcAI_TextToSpeech_System;

var
  Translator: TsgcAIOpenAITranslator;
begin
  Translator := TsgcAIOpenAITranslator.Create(nil);
  Translator.OpenAIOptions.ApiKey := 'sk-...';
  Translator.AudioRecorder := TsgcAudioRecorderMCI.Create(nil);
  Translator.TextToSpeech  := TsgcTextToSpeechSystem.Create(nil);

  Translator.OnAudioStart  := TranslatorAudioStart;
  Translator.OnAudioStop   := TranslatorAudioStop;
  Translator.OnTranslation := TranslatorTranslation;

  // Press to speak in any language; the audio is sent to Whisper,
  // translated to English, then spoken back through TTS.
  Translator.Start;
end;

What's inside

5 published properties, 2 methods, 3 events — pulled from the component reference.

Configuration

Published properties: OpenAIOptions, TranslatorOptions.

Diagnostics

Published properties: Version.

Audio

Properties: TextToSpeech, AudioRecorder.

Session

Methods: Start, Stop.

Translation

Events: OnTranslation.

Specifications & references

Authoritative sources for the protocols this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — TsgcAIOpenAITranslator Full property, method and event reference for this component.
Demo Project — Demos\AI\Translator Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Translate with AI?

Download the free trial and start building in minutes.