Sometimes it’s best to say things out loud. Other times reading some text, or the contents of a message are either difficult or might even be impossible if, for example, you or your user have visual impairments. You certainly can’t be silent if you’re narrating a movie. Whatever your purpose, if you need a way to generate speech from text, the latest Appercept AWS SDK for Delphi supports Text-to-Speech (TTS) using Amazon Polly. This great solution works smoothly both for desktop and cross platform apps.
What is Amazon Polly?
Amazon Polly is a Text-to-Speech cloud service utilising Machine Learning (ML) to provide the most natural human-like voice synthesis. Polly provides various voices for different genders, languages, and ages. Polly supports Speech Synthesis Markup Language (SSML) to give more control and enhance the synthesis.
Here is how we say something…
Request := TPollySynthesizeSpeechRequest.Create;
Request.OutputFormat := 'mp3';
Request.Text := 'Hello, Polly!';
Request.VoiceId := 'Aria';
Client := TPollyClient.Create;
Response := Client.SynthesizeSpeech(Request);
if Response.IsSuccessful then
// Do something with Response.AudioStream
To use enable and use SSML, just set the request property TextType to “ssml” and make sure you wrap the value in Text with a “<speak>” tag. For example:
Request.TextType := 'ssml';
Request.Text := ‘<speak>Hello, <break time="500ms"/>Polly!</speak>';
How can I use Amazon Polly in my cross platform apps?
Why not check out the Polly Speak demo in our AWS SDK for Delphi Samples on GitHub for a complete example.
What will you “say” with Delphi and Polly? Why not tell us @ApperceptHQ.
About Appercept AWS SDK for Delphi
Appercept AWS SDK for Delphi is available exclusively on GetIt with active Enterprise or Architect subscriptions for Embarcadero Delphi or RAD Studio. You can install the SDK through the GetIt Package Manager.