Plugin Documentation

PollyVoice
Amazon Polly text-to-speech for Blueprints and C++

Turn text and SSML into playable sounds at runtime, lip-sync characters with viseme speech marks, build SSML without typing tags, manage pronunciation lexicons, cache every line in memory and on disk, and run long S3 synthesis tasks — built on the official AWS SDK for C++.

v1.0
UE 4.27 & 5.8
Win64, Linux & Android
Category Audio
85 Blueprint nodes
Alpha XP

Overview

PollyVoice gives your game a voice for any text known only at runtime: player names, procedural quests, AI-generated dialogue, accessibility narration, or simply thousands of lines you do not want to record. Requests run on background worker threads with automatic retries; every result arrives on the game thread.

  • Synthesize Speech: text or SSML to a UPollyVoiceSoundWave (16-bit PCM, 8 or 16 kHz) that plays like any sound: Standard, Neural, Long-Form and Generative engines, language codes, lexicons.
  • Synthesize With Speech Marks: the sound plus viseme, word, sentence and SSML marks; Get Speech Marks for timings only.
  • Synthesize And Play 2D / At Location, Synthesize To File (MP3, Ogg Vorbis, PCM, WAV), Preload Phrases.
  • UPollyVoiceLipSyncComponent: plays speech, drives viseme morph targets with smooth blending and fires On Viseme, On Word, On Sentence, On SSML Mark and On Finished.
  • 17 pure SSML builder nodes: breaks, emphasis, prosody, max duration, say-as, phonemes, aliases, languages, marks, whisper, newscaster style and more.
  • Memory + disk cache keyed by text and voice settings: a line is paid for once, then plays instantly, even after a restart.
  • Voices, lexicons and asynchronous S3 synthesis tasks; Amazon Cognito identity pools, static keys or the default AWS chain.

Requirements

RequirementDetails
Unreal Engine4.27 and 5.8
PlatformsWin64, Linux and Android
ModulesPollyVoice (Runtime), PollyVoiceSdk (prebuilt AWS SDK for C++ 1.11.916 in Source/ThirdParty)
DependenciesNo other plugins. On Linux and Android the SDK uses the engine's libcurl, OpenSSL and certificate store.
AWSAn AWS account. Polly bills per character synthesized (speech marks are billed like audio); cached lines cost nothing.

Installation

  1. Install PollyVoice from Fab into your engine, or copy the PollyVoice folder into your project's Plugins folder.
  2. Enable PollyVoice in Edit > Plugins and restart the editor.
  3. Open Project Settings > Plugins > PollyVoice: set Region, Identity Pool Id and a Default Voice.
  4. C++ only: add PublicDependencyModuleNames.Add("PollyVoice"); to your Build.cs.
Several AWS plugins in one projectEach Alpha XP cloud plugin carries its own copy of the SDK under a plugin-specific name, so they install side by side without conflicts.

Setting up AWS

  1. Pick a region where Polly offers the voices you need (Neural and Generative voices are not in every region).
  2. In Amazon Cognito create an identity pool. Enable guest access if players may hear speech before signing in.
  3. Give the pool's player role (guest and/or authenticated) only what the game client needs — synthesis, voices and reading lexicons:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PollyVoicePlayers",
      "Effect": "Allow",
      "Action": ["polly:SynthesizeSpeech", "polly:DescribeVoices"],
      "Resource": "*"
    },
    {
      "Sid": "PollyVoiceReadLexicons",
      "Effect": "Allow",
      "Action": ["polly:GetLexicon", "polly:ListLexicons"],
      "Resource": "arn:aws:polly:us-east-1:123456789012:lexicon/*"
    }
  ]
}

To limit players to your own lexicons, replace lexicon/* with names such as lexicon/MyGame* (a request that names a lexicon is checked against that lexicon's ARN).

Admin and tool nodes

Put Lexicon, Delete Lexicon and the three synthesis-task nodes are meant for editor tools, build pipelines and servers. Give them a separate role or user, never the player role:

{
  "Version": "2012-10-17",
  "Statement": [
    { "Effect": "Allow", "Action": ["polly:PutLexicon", "polly:DeleteLexicon"],
      "Resource": "arn:aws:polly:us-east-1:123456789012:lexicon/MyGame*" },
    { "Effect": "Allow", "Action": ["polly:StartSpeechSynthesisTask", "polly:GetSpeechSynthesisTask", "polly:ListSpeechSynthesisTasks"],
      "Resource": "*" },
    { "Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::my-voice-bucket/voice/*" },
    { "Effect": "Allow", "Action": "sns:Publish", "Resource": "arn:aws:sns:us-east-1:123456789012:voice-done" }
  ]
}

Polly writes task output with the caller's permissions, so the caller needs s3:PutObject on the output bucket (and sns:Publish when a topic is given).

Never ship access keysStatic keys in the settings end up in DefaultGame.ini and in packaged games. Use them only for development, editor tools and servers; players should use the identity pool. Shipping builds refuse settings keys unless Allow Static Keys In Shipping is enabled.

Quick start

1. Say something

  1. Add Synthesize And Play 2D to Begin Play. Text Welcome back, commander., Options empty (uses the Default Voice).
  2. From On Failure print Error > Message. Done: the line plays; the second time it plays straight from the cache.

2. A talking character

  1. Add a Poly Voice Lip Sync component to your character. In its details set Viseme Map from Make Default Viseme Map (or type your own morph target names).
  2. Call Synthesize With Speech Marks with the line and Options.Voice = Matthew.
  3. On Success: Play Speech on the component with Speech > Sound (leave Marks empty — they are stored in the sound).
  4. Bind On Word to highlight subtitle words and On Finished to continue the dialogue.

3. Expressive lines with SSML

Build Make SSML Document( SSML Prosody( "Get down", Rate 120 ) + SSML Break(Strong) + SSML Amazon Effect( "they can hear us", Whispered ) ) and pass it as Text — Text Type Auto recognises the <speak> document.

4. Loading screen

Call Preload Phrases with every line of the level. During gameplay use Get Cached Sound (instant, no network) or Synthesize Speech (also instant for cached lines).

Lip sync

Polly reports a viseme (mouth shape) code with a start time for every sound of the speech: p t S T f k i r s u @ a e E o O sil (codes are case-sensitive). Build Timeline adds end times; Evaluate Morph Weights turns the timeline into morph-target weights at any time, blending each shape into the next over Blend Time. The lip-sync component does this every frame and applies the weights to the owner's first skeletal mesh (or the mesh given to Set Target Mesh).

  • Sync Offset (default 0.05 s) moves the mouth slightly ahead of the audio to hide output latency.
  • Use Build Viseme Curves to bake float curves (time → weight) for Sequencer, Timelines or an Animation Blueprint instead of the component.
  • Lip sync without playing audio: Play Timeline, for example for audio from a synthesis task with marks from Get Speech Marks.
  • Export Subtitles SRT writes SRT subtitles from the sentence (or word) marks.

SSML builder

Every builder node wraps a fragment in one tag, so builders chain. Send player-typed text through Escape Text For SSML first. Neural and Generative voices ignore some tags (emphasis, pitch, whisper); Polly rejects invalid SSML with InvalidSsmlException.

Cache

Every synthesized line is stored under a key made from the text, voice, engine, language, lexicons, sample rate and text type. The memory cache (default 32 MB, least recently used lines dropped first) makes repeats instant; the disk cache (default 256 MB in Saved/PollyVoice) keeps lines across sessions as <key>.wav + <key>.json (speech marks). Speech marks are cached per type, so asking for visemes after words only requests the visemes. Set Bypass Cache in the options for one-off lines.

Shipping pre-baked voiceRun your lines once with the disk cache enabled and ship the cache folder, or bake files with Synthesize To File.

Node reference

85 nodes. Call = executable, Pure = no exec pins, Latent = async node with output pins (each fires exactly once on the game thread; Cancel on its return value stops it).

Synthesis

NodeKindInputsOutputsPurpose
Synthesize SpeechLatentText, OptionsOn Success / On Failure (Speech, Error)Text or SSML to a playable sound, from the cache when possible.
Synthesize With Speech MarksLatentText, Options, Mark TypesOn Success / On Failure (Speech, Error)Sound plus speech marks (empty Mark Types = visemes, words, sentences and SSML marks).
Get Speech MarksLatentText, Options, Mark TypesOn Success / On Failure (Marks, Error)Timings only, no audio.
Synthesize To FileLatentText, Options, Format, File PathOn Success / On Failure (File Path, Billed Characters, Error)MP3, Ogg Vorbis, raw PCM or WAV on disk (relative paths below Saved).
Synthesize And Play 2DLatentText, Options, Volume, PitchOn Started / On Failure (Audio Component, Speech, Error)Synthesizes and plays a 2D line.
Synthesize And Play At LocationLatentText, Options, Location, Attenuation, Volume, PitchOn Started / On Failure (Audio Component, Speech, Error)Synthesizes and plays a line in the world.
Count Billable CharactersPureTextIntegerCharacters Polly bills (SSML tags are free).

Cache

NodeKindInputsOutputsPurpose
Preload PhrasesLatentTexts, Options, With Speech Marks, Max ConcurrencyOn Progress (Done, Total), On Completed (Loaded Count, Failed Texts, First Error)Fills the cache in parallel; cached lines are skipped.
Get Cached SoundCallText, OptionsSound or NoneThe cached sound without any network access.
Is CachedPureText, OptionsBooleanTrue when the line is in the memory or disk cache.
Remove From CacheCallText, Options–Forgets one line (memory and disk).
Clear CacheCallMemory, Disk–Empties one or both caches.
Set Cache DirectoryCallDirectory–Moves the disk cache (relative = below Saved).
Set Cache LimitsCallMemory MB, Disk MB–Changes the budgets (0 keeps a value).
Get Cache StatsPure–Cache StatsEntries, bytes and limits of both caches, folder path.

Lip sync component (UPollyVoiceLipSyncComponent)

NodeKindInputsOutputsPurpose
Play SpeechCallSound, MarksAudio ComponentPlays a sound (3D attached to the owner, or 2D) and lip-syncs it; empty Marks = the marks stored in a PollyVoice sound.
Play TimelineCallTimeline–Lip sync and events without audio.
StopCall––Stops audio and lip sync, resets the mouth, fires On Finished.
Is PlayingPure–BooleanTrue while speech or a timeline runs.
Get Current VisemePure–StringViseme code shown now ("sil" when silent).
Get Current WordPure–String, Word IndexWord spoken now.
Get Playback TimePure–FloatSeconds since the speech started.
Set Target MeshCallMesh–Drives another skeletal mesh (for example a head).
Set Viseme MapCallNew Map–Replaces the viseme map and resets old morph targets.
Get Morph WeightsPure–Morph WeightsWeights applied this frame (to drive an Animation Blueprint yourself).
On Viseme / On Word / On Sentence / On SSML Mark / On FinishedEvent–Viseme + Duration / Word + Index / Text / Mark Name / –Component events (not counted as nodes).

Lip sync and timing helpers

NodeKindInputsOutputsPurpose
Build TimelinePureMarks, DurationTimelineViseme / word / sentence / mark lists with start and end times.
Get Viseme At TimePureTimeline, TimeBoolean, Viseme, ProgressActive viseme and progress through it.
Get Word At TimePureTimeline, TimeBoolean, Word, Word IndexWord spoken at a time.
Get Sentence At TimePureTimeline, TimeBoolean, SentenceSentence spoken at a time (subtitle line).
Parse Speech MarksPureJSON LinesBoolean, MarksReads Polly's JSON-lines mark format (task output files).
Make Default Viseme MapPurePrefixViseme MapMaps Polly visemes to PP, FF, TH, DD, kk, CH, SS, RR, aa, E, ih, oh, ou morph names.
Map Viseme To Morph TargetsPureViseme, Viseme MapMorph WeightsMorph targets one viseme drives.
Evaluate Morph WeightsPureTimeline, Viseme Map, Time, Blend Time, IntensityMorph WeightsBlended weights of every morph of the map at a time.
Build Viseme CurvesCallOuter, Timeline, Viseme Map, Blend TimeMorph CurvesOne float curve per morph target.
Apply Morph WeightsCallMesh, Weights–Sets the morph targets on a skeletal mesh.
Export Subtitles SRTPureTimeline, Max CharactersStringSRT subtitles from sentence (or word) marks.

SSML builder

NodeKindInputsOutputsPurpose
Make SSML DocumentPureBodyStringWraps a fragment in <speak>.
SSML BreakPureStrength, Time MsStringA pause of a strength or an exact length.
SSML EmphasisPureText, LevelStringStressed words (standard voices).
SSML ProsodyPureText, Rate %, Pitch %, Volume dBStringSpeed, pitch and loudness.
SSML Max DurationPureText, SecondsStringFits a line into a time slot.
SSML Say AsPureText, Interpret As, FormatStringCharacters, numbers, dates, times, addresses, phone numbers, bleeps.
SSML PhonemePureText, Phonetic, X-SAMPAStringExact pronunciation in IPA or X-SAMPA.
SSML SubPureText, AliasStringSpeaks an alias instead of the text.
SSML LanguagePureText, Language CodeStringForeign phrase with the current voice.
SSML ParagraphPureTextStringParagraph with its pause.
SSML SentencePureTextStringSentence with its pause and sentence mark.
SSML MarkPureNameStringNamed point reported as an SSML speech mark.
SSML Amazon EffectPureText, EffectStringWhispered, soft phonation or dynamic range compression.
SSML Speaking StylePureText, StyleStringNewscaster or conversational (supported neural voices).
Escape Text For SSMLPureTextStringMakes any text safe inside SSML.
Append SSMLPureDocument, FragmentStringAdds a fragment inside a document's </speak>.
Strip SSML TagsPureSSMLStringSpoken text without tags (subtitles).

Sounds and audio files

NodeKindInputsOutputsPurpose
Create Sound Wave From PcmCallPCM, Sample Rate, Num ChannelsSoundA playable sound from your own 16-bit samples.
Save PCM As WAVCallPCM, Sample Rate, Num Channels, File PathBooleanWrites a WAV file.
Load WAV As Sound WaveCallFile PathSound, ProblemPlays WAV files from disk at runtime (8/16/24/32-bit PCM, float).
Get Pcm DataPureTarget: PollyVoice SoundBytesThe sound's 16-bit PCM.
Get Sound Speech MarksPureTarget: PollyVoice SoundMarksSpeech marks stored in the sound.
Get TimelinePureTarget: PollyVoice SoundTimelineThe sound's marks as a timeline.
Get Spoken TextPureTarget: PollyVoice SoundString, Voice IdText and voice the sound was made from.

Voices

NodeKindInputsOutputsPurpose
Describe VoicesLatentLanguage Code, Engine, Include Additional LanguagesOn Success / On Failure (Voices, Error)Voices of the region, filtered.
Get Voice InfoLatentVoice IdOn Success / On Failure (Voice, Error)One voice's gender, languages and engines ("VoiceNotFound" when unknown).
Find Voices For LanguagePureVoices, Language Code, Engine, Gender, Include BilingualVoicesFilters a voice list locally, for example for a voice picker.

Lexicons

NodeKindInputsOutputsPurpose
Put LexiconLatentName, PLS ContentOn Success / On Failure (Error)Stores a pronunciation lexicon (admin).
Get LexiconLatentNameOn Success / On Failure (Lexicon, Content, Error)Downloads a lexicon.
List LexiconsLatent–On Success / On Failure (Lexicons, Error)All lexicons of the region.
Delete LexiconLatentNameOn Success / On Failure (Error)Deletes a lexicon (admin).

Synthesis tasks (S3)

NodeKindInputsOutputsPurpose
Start Speech Synthesis TaskLatentText, Options, Format, Output Bucket, Key Prefix, SNS Topic Arn, Mark TypesOn Success / On Failure (Task, Error)Long text (up to 100,000 characters) to an S3 file (admin).
Get Speech Synthesis TaskLatentTask IdOn Success / On Failure (Task, Error)Status and output URI of a task.
List Speech Synthesis TasksLatentStatus, Max Results, Next TokenOn Success / On Failure (Tasks, Next Token, Error)One page of tasks.

Config and identity

NodeKindInputsOutputsPurpose
Set RegionCallRegion–Region for every following request.
Set Credential ModeCallMode–Overrides the credential mode at runtime.
Set Login TokenCallProvider, Token–Signs the player in to the identity pool.
Clear Login TokensCall––Back to a guest identity.
Set Static CredentialsCallAccess Key Id, Secret Access Key, Session Token–Keys from your backend (Static Keys mode).
Get Identity IdPure–StringThe player's Cognito identity id.
Make User Pool Provider NamePureRegion, User Pool IdStringLogin key of a Cognito user pool.
Is ConfiguredPure–Boolean, ProblemFalse with a reason when settings are incomplete.
Resolve IdentityLatentForce RefreshOn Success / On Failure (Identity Id, Error)Fetches credentials ahead of the first request.
Set Default VoiceCallVoice Id–Runtime default voice.
Set Default EngineCallEngine–Runtime default engine.
Set Default LanguageCallLanguage Code–Runtime default language code.
Set Default Sample RateCallSample Rate–Runtime default sample rate.
CancelCallTarget: latent node–None of the node's pins fire any more.
Is FinishedPureTarget: latent nodeBooleanTrue after the node finished or was cancelled.

Credentials

ModeUse forHow
Cognito Identity PoolGame clientsGuests get unauthenticated credentials; after Set Login Token the player gets the authenticated role. Credentials refresh automatically.
Static KeysDevelopment, editor tools, serversSettings keys or Set Static Credentials.
Default Credential ChainServers and build toolsEnvironment variables, the ~/.aws profile, ECS and EC2 roles.

C++ API

// Build.cs: PublicDependencyModuleNames.Add("PollyVoice");
#include "PollyVoiceLibrary.h"
#include "PollyVoiceSoundWave.h"

FPollyVoiceSynthesisOptions Options;
Options.Voice = TEXT("Amy");
UPollyVoiceLibrary::SynthesizeNative(TEXT("Hello there."), Options, /*bWithSpeechMarks*/ true,
    FPollyVoiceNativeDelegate::CreateLambda([this](const FPollyVoiceSpeech& Speech, const FPollyVoiceError& Error)
    {
        // game thread; keep Speech.Sound referenced (UPROPERTY) or play it now
        if (Speech.Sound) { LipSync->PlaySpeech(Speech.Sound, Speech.Marks); }
    }));

The latent node classes (UPollyVoiceSynthesizeAction and the others) can also be created from C++ through their static factory functions; bind the delegates, then call Activate().

Types

TypeKindMembers
FPollyVoiceSynthesisOptionsStructVoice, Engine, Language Code, Lexicons, Sample Rate, Text Type, Bypass Cache (all optional)
FPollyVoiceSpeechStructSound, Marks, Duration, Sample Rate, Billed Characters, From Cache, Cache Key, Voice
FPollyVoiceSpeechMarkStructType, Time (s), Start / End Offset, Value
FPollyVoiceTimeline / FPollyVoiceTimedItemStructVisemes, Words, Sentences, SSML Marks, Duration / Start, End, Value, offsets
FPollyVoiceVisemeMapping / MorphWeight / MorphCurveStructViseme, Morph Target, Weight / Morph Target, Weight / Morph Target, Curve
FPollyVoiceVoiceInfoStructId, Name, Gender, Language Code, Language Name, Additional Language Codes, Supported Engines
FPollyVoiceLexiconInfoStructName, Alphabet, Language Code, Last Modified, Arn, Lexeme Count, Size
FPollyVoiceTaskStructTask Id, Status, Status Reason, Output Uri, Creation Time, Request Characters, SNS Topic, format, voice, engine, language, lexicons, mark types
FPollyVoiceCacheStatsStructMemory / disk entries, bytes and limits, directory
FPollyVoiceErrorStructCode, Message, Http Status, Retryable
UPollyVoiceSoundWaveClassRuntime sound wave from PCM; keeps marks, text and voice
EnumsEnumEngine, Text Type, File Format, Mark Type, Gender, Task Status, Break Strength, Emphasis, Say As, Effect, Speaking Style, Credential Mode

Settings

Project Settings > Plugins > PollyVoice (saved to DefaultGame.ini). Changes apply to the next request.

SettingDefaultDescription
Regionus-east-1Region of Polly and the identity pool.
Credential Mode / Identity Pool Id / Allow Guest AccessCognito / (empty) / OnWhere credentials come from.
Access Key Id / Secret Access Key / Allow Static Keys In Shipping(empty) / OffStatic Keys mode, development and servers only.
Endpoint Override, timeouts, Max Retries, Worker Threads, Verify SSL, Log Sdk Warnings– / 30000 / 5000 / 3 / 4 / On / OnConnection.
Default VoiceJoannaVoice when a request leaves Voice empty.
Default EngineNeuralEngine for "Project Default".
Default Language Code(empty)For bilingual voices.
Default Sample Rate160008000 or 16000 for sounds; MP3 / Ogg files also 22050, 24000.
Memory Cache / Max Memory Cache MBOn / 32In-memory line cache.
Disk Cache / Cache Directory / Max Disk Cache MBOn / PollyVoice / 256Disk cache below Saved.

Engine notes

  • UE 4.27: PollyVoice sounds play from in-memory PCM (like editor previews). Looping, attenuation, concurrency and sound classes work as usual.
  • UE 5.8: PollyVoice sounds stream through a sound generator, one per playing instance, so the same sound can play several times at once.
  • Sounds are created at runtime and are not assets: keep them in a variable (or a UPROPERTY in C++) as long as you want to replay them; the cache recreates them cheaply.
  • Polly returns mono 16-bit PCM at 8 or 16 kHz for playable sounds; use Synthesize To File with MP3 / Ogg at 22050 or 24000 Hz for higher fidelity assets.
  • Text limits per request: 3,000 billed characters (6,000 total with SSML tags). Use a synthesis task for longer text.

Troubleshooting

Error codeCause and fix
NotConfiguredSet the Identity Pool Id in Project Settings > Plugins > PollyVoice, or switch the credential mode.
AccessDeniedExceptionThe role lacks polly:SynthesizeSpeech (or the lexicon / task permission). See Setting up AWS.
ValidationException / EngineNotSupportedExceptionThe voice does not support the engine (for example a Standard-only voice with Neural) or the region lacks it. Check with Get Voice Info.
InvalidSsmlExceptionBroken SSML. Escape player text with Escape Text For SSML; check that tags are supported by the voice's engine.
TextLengthExceededExceptionOver 3,000 billed characters: split the text or use Start Speech Synthesis Task.
LexiconNotFoundExceptionA lexicon named in Options does not exist in this region.
InvalidSampleRateExceptionUse 8000 or 16000 for sounds and PCM / WAV, or up to 24000 for MP3 / Ogg files.
NoAudioSynthesize And Play could not play: no world, no audio device (dedicated server) or audio disabled.
CacheDisabledPreload Phrases needs the memory or the disk cache.
UnavailableThe SDK library could not be loaded or the engine is shutting down. Check the Output Log for LogPollyVoice errors.

Credits

© 2026 Alpha XP — alphaxp.net · Support: support@alphaxp.net. Includes the AWS SDK for C++ and the AWS Common Runtime (Apache License 2.0). Amazon Polly is a service of Amazon Web Services. Built for Unreal Engine 4.27 and 5.8.