Text-to-Speech in Delphi

Add voice output to your Delphi applications with Amazon Polly.

Beyond SAPI

The Windows Speech API gets you basic text-to-speech, but the voice quality is limited and language support is whatever the user has installed. Amazon Polly gives you dozens of neural voices across multiple languages, all server-side.

With the AWS SDK for Delphi, you pick a voice, send text, and get an audio stream back. The neural voices are noticeably better than anything you get from platform APIs.

Example

Generate speech from text:


uses
  AWS.Polly;

var
  Client: IPollyClient;
  Request: IPollySynthesizeSpeechRequest;
  Response: IPollySynthesizeSpeechResponse;
begin
  Client := TPollyClient.Create;

  Request := TPollySynthesizeSpeechRequest.Create;
  Request.Text := 'Hello from Delphi!';
  Request.VoiceId := 'Joanna';
  Request.Engine := 'neural';
  Request.OutputFormat := 'mp3';

  Response := Client.SynthesizeSpeech(Request);
  if Response.IsSuccessful then
    Response.AudioStream.SaveToFile('speech.mp3');
end;
      

Where this fits

  • Accessibility for visually impaired users
  • Voice prompts in kiosk and point-of-sale applications
  • Reading content aloud in e-learning software
  • IVR systems