Elderlight StudioNPC Voice & Dialogue – documentationAll documentation

NPC Voice & Dialogue – Documentation

Offline neural voices for your characters, made inside Unreal Engine. Write what a character says, press Generate Audio, and every line becomes a normal SoundWave in that character’s voice. On top of that: barks with priorities and pauses, subtitles, a conversation wheel, and mouths that move with the voice.

The voices come from Kokoro-82M (Apache-2.0), run on the CPU by Unreal’s own Neural Network Engine (NNE + ONNX Runtime). The text-to-phoneme part is a C++ port of misaki (Apache-2.0). No Python, no internet, no account, no per-line fees: the generated audio is yours.

Contents

  1. Requirements
  2. Installation
  3. Quick start: the demo (2 minutes)
  4. Concepts and how it works
  5. Giving your own character a voice
  6. Voice profiles
  7. Voice lines and Generate Audio
  8. Pronunciation
  9. Speaking in the game: NV Voice
  10. Subtitles
  11. Conversations and the wheel
  12. Mouths: morph target, jaw bone (MetaHuman), your own rig
  13. Text made in the game (Speak Text)
  14. Customizing and extending
  15. Saving and loading
  16. Project settings reference
  17. Blueprint / C++ API reference
  18. Console commands
  19. Performance and size
  20. Packaging your game
  21. Troubleshooting
  22. Known limitations
  23. Support, licences and credits

1. Requirements

Engine Unreal Engine 5.8
Platforms Windows 64-bit (editor and packaged games)
Plugin dependencies NNERuntimeORT (Epic’s ONNX Runtime for NNE) and Enhanced Input – engine plugins, enabled automatically
Language English (American and British voices)
Project type Blueprint-only or C++. No C++ knowledge needed.
CPU Any x64 CPU. Generation speed below is for a current 8-core desktop CPU.

2. Installation

From Fab: install the plugin to your engine from the Fab library (Epic Games Launcher), then enable it in your project: Edit > Plugins > search “NPC Voice” > tick NPC Voice & Dialogue > restart the editor.

Into one project only: copy the NPCVoice folder to <YourProject>/Plugins/NPCVoice (so that Plugins/NPCVoice/NPCVoice.uplugin exists) and open the project.

To see the plugin’s assets, tick Settings > Show Plugin Content in the Content Browser; they are under Plugins > NPC Voice Content.

The plugin is large (about 400 MB) because it carries the voice model. The model is loaded the first time something is generated or spoken from text (about a second), not when the editor or the game starts.

3. Quick start: the demo (2 minutes)

  1. Open the map /NPCVoice/Demo/Maps/NV_Demo (Plugins > NPC Voice Content > Demo > Maps).
  2. Press Play. Fly with WASD + mouse (the demo game mode uses a simple flying pawn).
  3. Four characters stand in the village: Villager, Merchant, Guard (at the gate) and Herbalist. Come closer than 3.5 m: the character greets you. Within 15 m they talk to themselves now and then.
  4. Look at one of them: “[E] Talk to …” appears. Press E (gamepad X). The wheel opens.
  5. Choose a topic: mouse direction, left stick, arrow keys / D-pad or number keys 1-9; say it with left click, Enter, Space or gamepad A. The player asks in their own voice, the character answers, the mouth moves and the subtitles show who speaks. Esc, right click or gamepad B say goodbye.
  6. Open the console (~) and try: – NV.Say Guard Alert – the guard shouts an alert. – NV.Say Merchant text Welcome back, my friend. That will be 12 silver. – any text, made now. – NV.SelfTest – loads the model, says a test sentence, prints the timings in the log.

Then, in the editor:

  1. Open Demo/Voices/VP_Guard, change Voice or Pitch, press Preview.
  2. Open Demo/Lines/VL_Guard, change the text of one line, press Generate Audio: only that line is made again (about half a second). Play the map and use NV.Say Guard <the line's event>.

Everything the demo uses is in /NPCVoice/Demo: Voices (profiles), Lines (lines + their audio in <Name>_Audio), Conversations, Blueprints/BP_NV_DemoNPC (the character: NV Voice + NV Conversation) and BP_NV_DemoGameMode.

4. Concepts and how it works

Concept What it is
Voice model (NV_Kokoro) The neural network, its 28 voices and the pronunciation data. Ships with the plugin; you do not edit it.
Voice profile (NVVoiceProfile) How one character (or one kind of character) sounds: a voice, optionally blended with a second one, speed, pitch, volume, its own pronunciations.
Voice lines (NVVoiceLines) What a character says: lines with an event (Greeting, Alert, Pain, Idle…), a text and the generated audio.
NV Voice (component) On an actor: says its lines in 3D, one at a time, with priorities, pauses, cooldowns and subtitles, and moves the mouth.
Conversation (NVConversation) The topics of the conversation wheel: what the player asks, what the character answers.
NV Conversation (component) Makes an actor talkable: the “Talk to” prompt, the wheel, the turns.
Style (NVStyle) Fonts, colours and sizes of the subtitles, the prompt and the wheel.

What Generate Audio does with a line

  1. Normalize the text – numbers, money, years, ordinals, abbreviations: $5.50 → “five dollars and fifty cents”, 1984 → “nineteen eighty-four”, 21st → “twenty-first”, USA → “U S A”.
  2. Tag the words – a small part-of-speech tagger decides noun / verb / adjective, so “I read it yesterday” and “I read every day”, “a record” and “to record” are said correctly.
  3. Phonemes – each word is looked up in the dictionaries (about 180,000 words with stress; American or British, following the voice’s accent). Your Pronunciations come first; -s / -ed / -ing forms are derived; words no dictionary knows are read by spelling rules (and listed in a notification).
  4. Voice – the phonemes and the voice’s style go through Kokoro-82M on the CPU (NNE / ONNX Runtime). Out comes 24 kHz speech.
  5. Finish – speed and pitch are applied, the loudness is evened out across all lines, then your Volume.
  6. Save – a SoundWave next to the lines asset, plus a mouth curve (100 values per second from the loudness) stored in the line.

In the game, NV Voice plays those SoundWaves like any other sound; the model is not involved. Only Speak Text (text known only at run time) runs steps 1-6 in the game, on a worker thread.

5. Giving your own character a voice

A. The voice (once per kind of character)

  1. Content Browser > right click > Miscellaneous > Data Asset > NVVoiceProfile. Name it, e.g. VP_Blacksmith.
  2. Pick a Voice (for example am_onyx), optionally a Blend Voice, set Speed / Pitch, and fill in Speaker Name (“Blacksmith”). Press Preview until it sounds right.

B. The lines

  1. Data Asset > NVVoiceLines, e.g. VL_Blacksmith. Set Voice to VP_Blacksmith.
  2. Add lines. For each: Event (Greeting, Idle, Farewell, Trade…) and Text. Several lines with the same event = variations; one is picked each time.
  3. Press Generate Audio (top of the asset). Check the notification for words read by rules (section 8).

C. The character

  1. Open your character Blueprint. Add > NV Voice. Set Lines = VL_Blacksmith.
  2. For greetings and chatter without any Blueprint: Greet Distance = 350, Idle Range = 1500.
  3. Or speak from your own logic: NV Voice > Speak Event (Event Trade).
  4. A mouth: section 12. A conversation: section 11.

The NV Voice finds the sound position by itself (Voice Socket head on the actor’s skeletal mesh; for a MetaHuman, the Body or Face mesh both have it).

Blueprint example – say something when the player opens the shop

Event OnShopOpened
  └─ NV Voice → Speak Event (Event = "Trade", Priority = Normal)

Blueprint example – a guard shouts when it sees the player, and the line can’t be cut by chatter

On See Pawn (Pawn Sensing)
  └─ NV Voice → Speak Event (Event = "Alert", Priority = Important)

6. Voice profiles

NVVoiceProfile data asset.

Property Default Meaning
Voice am_michael One of the 28 voices (drop-down). af_ / am_ = American female / male, bf_ / bm_ = British. The accent also decides the pronunciation (American or British dictionary).
Blend Voice none A second voice mixed in.
Blend Amount 0 0 = only Voice, 1 = only Blend Voice. 0.3-0.5 gives a new voice between the two.
Speed 1 0.5-2. 0.85 slow and careful (old, tired), 1.15 hurried (young, nervous).
Pitch 0 Semitones, -6..+6. The tempo is kept. ±1.5 sounds most natural; beyond ±3 it starts to sound processed.
Volume 1 0.1-2. All lines are evened out to the same loudness first, then this is applied.
Pronunciations empty Words this character says its own way (section 8).
Speaker Name empty The name in the subtitles when the NV Voice has none.
Preview Text + Preview a sample sentence Generates and plays the text in the editor with the current settings.

The 28 voices

American female af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky
American male am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa
British female bf_alice, bf_emma, bf_isabella, bf_lily
British male bm_daniel, bm_fable, bm_george, bm_lewis

The demo’s profiles as a starting point: the guard = bm_george, speed 0.95, pitch -1; the old herbalist = bf_lily + bf_alice 0.35, speed 0.9, pitch -1.5; the merchant = af_bella, speed 1.05. Try blends of two voices of the same accent, e.g. am_michael + am_fenrir 0.4 for a gruffer man.

Changing anything in a profile marks all lines that use it as changed: the next Generate Audio makes them again.

7. Voice lines and Generate Audio

NVVoiceLines data asset: Voice (the profile) + Lines.

Line field Default Meaning
Id from event + text Unique in the asset. Used by Speak Line and by conversations. Give your own ids to lines you refer to (Q1_Offer).
Event – What the line is for: any name. Speak Event picks one of the event’s lines.
Text – What is said and shown. Inline control: [Mokresh](/mˈOkɹɛʃ/) exact phonemes, [word](-1) less stress, [word](2) more stress.
Weight 1 How often the line is picked among its event’s lines. Speak Event never repeats the line said last when there are others.
Audio – The generated SoundWave – or your own recording: put a SoundWave here and it is kept, never replaced.
Generated From (advanced) – A fingerprint of the text + voice the audio was made with. Empty = your own recording.

Buttons

  • Generate Audio – makes the audio of every line whose text or voice changed (or that has none).
  • Regenerate All – makes all lines again (e.g. after you changed a global pronunciation).

The SoundWaves are saved in a folder next to the asset: VL_Blacksmith → VL_Blacksmith_Audio/, one per line, named after the line id. The lines asset and the SoundWaves are saved by themselves. A line takes about a tenth of its length to make (a 4-second line ≈ 0.4 s) plus about a second the first time, to load the model.

After generating, a notification lists the words read by rules (unknown to the dictionaries) – mostly names. Listen to them and fix the ones that sound wrong (section 8).

The SoundWaves are ordinary assets: set compression, Sound Class, concurrency, use them in Sequencer or MetaSounds. Do not rename them by hand; Generate Audio finds them by the line id.

Suggested event names (all optional, any name works): Greeting, Farewell, Idle, Alert, Pain, Death, Trade, Thanks, Refuse, and for conversations Talk_<Topic>.

8. Pronunciation

Most text needs nothing. Names of your world are where the rules guess. Fix a word once:

Where Scope Example
Project Settings > Plugins > NPC Voice > Pronunciations every character Mokresh = mo kresh
A profile’s Pronunciations one character (an accent, a nickname) Mokresh = /mˈOkɹɛʃ/
Inline in a line’s text this line only Welcome to [Mokresh](/mˈOkɹɛʃ/).

The value is either a respelling with ordinary words (mo kresh, ar wen) – usually enough – or exact phonemes between slashes. The phoneme alphabet is misaki’s: IPA plus single letters for diphthongs – A “day”, I “my”, O “go” (American), Q “go” (British), W “now”, Y “boy”; ˈ before the stressed vowel, ˌ secondary stress. Look at what a word becomes with Text To Phonemes (Blueprint, e.g. in an Editor Utility) and edit from there.

Words are matched ignoring case. After changing a global pronunciation, use Regenerate All on the affected line assets.

9. Speaking in the game: NV Voice

NV Voice component (UNVVoiceComponent) – put it on any actor.

Property Default Meaning
Voice
Lines none The character’s voice lines.
Speaker Name empty For the subtitles. Empty = the profile’s Speaker Name, else the actor’s label.
Text Voice none The profile for Speak Text (else the profile of Lines).
Playback
Voice Socket head The sound comes from this socket / bone of the actor’s skeletal mesh; else from the actor.
Attenuation none Empty = the settings’ one (default: clear to 20 m, gone at 40 m).
Volume Multiplier 1
Event Cooldowns Greeting 20, Idle 15, Pain 1 Seconds before the same event may be said again by an Idle or Normal request.
Subtitles
Subtitles on Show this character’s subtitles.
Mouth (section 12)
Mouth Morph Target empty The morph target opened with the voice (MouthOpen, jawOpen).
Mouth Mesh Component empty The component that has it (empty = found by itself).
Mouth Scale 1 0-2: how wide the mouth opens.
Ambient
Greet Distance 0 (off) Says Greet Event when the player comes this close (cm). Again only after the player left and the cooldown passed.
Greet Event Greeting
Idle Range 0 (off) Says Idle Event now and then while the player is this close (cm). Quiet while the player is in a conversation.
Idle Event Idle
Idle Interval 12-30 s A random time in this range between idle lines.

Priorities – what happens when the character is asked to speak:

Priority Use for While it is quiet While it is speaking
Idle chatter only after 4 × Pause Between Lines since its last line; cooldowns apply refused
Normal greetings, remarks after Pause Between Lines; cooldowns apply refused
Important alerts, conversation replies always interrupts Idle and Normal
Critical pain, death always interrupts everything

Every Speak function returns false when the request was refused (busy, cooldown, no such line, no audio) – so you can try another event or do nothing.

Functions

Function Meaning
Speak Event (Event, Priority) One of the event’s lines, by weight.
Speak Line (Line Id, Priority) A line by its id.
Speak Text (Text, Priority) Any text, made now (section 13).
Speak Sound (Sound, Subtitle, Priority) Your own sound with a subtitle; the mouth follows its loudness.
Stop Speaking Stops the current line (On Line Finished with Interrupted = true).
Is Speaking True while speaking or while a Speak Text is being made.
Get Mouth Open 0-1, for your own face rig.
Get Current Text, Get Speaker Name, Get Time Left For your own subtitles / UI.

Events: On Line Started (Voice, Text, Duration), On Line Finished (Voice, Interrupted).

Hook: Can Speak (Event, Priority) – section 14.

10. Subtitles

Lines said within Subtitle Range of the player (settings, 15 m) appear at the bottom of the screen as “Speaker: text”, up to three at a time (newest at the bottom, one per speaker). Conversation lines are always subtitled, whatever the distance.

Turn them off: in the settings (Show Subtitles), per character (NV Voice > Subtitles), or at run time with Set Subtitles Enabled on the NV Subtitle Subsystem (Get NVSubtitleSubsystem node) – e.g. from your options menu. The look is in the style (section 14).

11. Conversations and the wheel

1. The conversation asset – Data Asset > NVConversation:

Property Default Meaning
Greeting Greeting Said by the character when the conversation opens (event or line id of its lines).
Topics empty The wheel’s entries, up to 8 at a time (below).
Goodbye Label Goodbye The last entry, always there.
Player Goodbye Bye The player’s line for it (event or id of the player’s lines).
Farewell Farewell The character’s answer (event or id).

Each topic:

Field Default Meaning
Id the label For your hooks and for Was Asked.
Label – Text on the wheel.
Player Line empty Event or id of the player’s lines. Empty = the label is shown as the player’s subtitle, unvoiced.
Reply – Event or id of the character’s lines.
Once off Gone from the wheel once asked.
Ends Conversation off The conversation closes after the reply.

2. The character – next to its NV Voice, Add > NV Conversation:

Property Default Meaning
Conversation none The asset above.
Face Player on The character turns to the player while talking.
Display Name empty “Talk to ” (empty = the NV Voice’s speaker name).

3. The player’s voice – the player’s questions are lines too:

  • Give the player pawn its own NV Voice with the player’s lines, or
  • set Player Voice Lines in the settings; an NV Voice with them is added to the player pawn when a conversation starts. By default it is the demo’s VL_Player (am_fenrir, an American male voice) – set your own or clear it.

The reply and the player line refer to events or line ids. A good pattern: in the character’s lines, give each answer the event Talk_<Topic> (Talk_Rumours), and several lines with that event for variety.

In the game

  • The prompt “[E] Talk to …” shows when the player is within Talk Range (3 m) of a talkable character and faces it (within about ±70°); the nearest and most central one wins.
  • The talk keys (settings: E, gamepad X) open the wheel. The character says its Greeting.
  • Movement is blocked while talking (the camera still turns); walking further than 2.5 × Talk Range (pushed, moved) ends the conversation.
  • Choosing a topic: the player’s line → On Topic Chosen → the character’s reply → back to the wheel.
  • From your own interaction system, call Start Conversation (NV Conversation) with the player pawn, and End Conversation (NV Conversation Subsystem) to close it.

Wheel controls: mouse direction / left stick / arrows / D-pad / Tab select; number keys 1-9 select and say; left click, Enter, Space, gamepad A say; right click, Esc, gamepad B say goodbye.

Example – a quest topic shown only at the right stage (Blueprint child of NV Conversation, override the hooks):

Is Topic Available (Player, Topic)
  ├─ Topic.Id == "Wolves" → return  QuestSystem.GetStage("Wolves") == 1
  └─ else                 → return  Parent: Is Topic Available    (keeps the "Once" rule)

On Topic Chosen (Player, Topic)
  └─ Topic.Id == "Wolves" → QuestSystem.Advance("Wolves")

12. Mouths: morph target, jaw bone (MetaHuman), your own rig

Every generated line carries a mouth curve (100 values a second, from the voice’s loudness). For your own recordings (Speak Sound, or your SoundWave in a line) the loudness is measured while it plays. Three ways to use it:

Morph target – set NV Voice > Mouth Morph Target to the morph target’s name (MouthOpen, jawOpen…). The skeletal mesh component with that morph target is found by itself (or name it in Mouth Mesh Component). Mouth Scale sets how wide. The demo character works this way.

Jaw bone – the NV Voice Jaw anim graph node (category NPC Voice) turns a bone with the voice of the actor’s NV Voice (found on the actor that owns the mesh, or its parent actor):

Pin / property Default Meaning
Jaw Bone – The jaw bone.
Open Rotation roll 14 The turn of the bone (in its own space) for a fully open mouth.
Mouth Override 0 Opens the mouth when the actor has no NV Voice (previews, your own logic).
Alpha 1 As every skeletal control.

MetaHuman, step by step

  1. Add NV Voice to the MetaHuman’s Blueprint (the actor BP_<Name>), set its Lines. Voice Socket head works.
  2. Open the face’s post-process Anim Blueprint: select the Face component, Anim Class / Post Process Anim Blueprint – usually ABP_Face_PostProcess (make a copy for your character if you do not want to change the shared one, and set the copy on the Face mesh).
  3. In its AnimGraph, before Output Pose, add NV Voice Jaw (Local To Component / Component To Local around it are added by the editor).
  4. Jaw Bone = FACIAL_C_Jaw, Open Rotation: roll 12-16 (try in the preview with Mouth Override = 1, then set Mouth Override back to 0).
  5. Compile, save, play: the jaw follows the voice.

If the MetaHuman’s face follows the body with a Leader Pose / Copy Pose, the post-process graph still runs on the face; if the jaw does not move, check that the Face component’s Disable Post Process Blueprint is off.

Your own rig – read Get Mouth Open (0-1) every frame (e.g. in your Anim Blueprint’s Event Blueprint Update Animation from the owning actor’s NV Voice) and drive a curve, a morph target set, a material, a puppet.

13. Text made in the game (Speak Text)

Speak Text says any text at run time: a name the player typed, a number, procedural quest text. The audio is made on a worker thread and starts when ready – the game does not wait.

  • Cost: about 0.1-0.2 s of CPU per second of speech, on one worker thread.
  • The first use loads the model and the pronunciation data (about 1 s + 2 s in the background). Call Preload Voice Model at level start (e.g. in the Level Blueprint’s Begin Play) so the first line does not wait.
  • Voice: the NV Voice’s Text Voice, else the profile of its Lines.
  • Subtitles, priorities and the mouth work as for generated lines. While a text is being made the character counts as speaking: a new request needs a higher priority, and then replaces it.
  • Your Pronunciations apply.
  • It needs the model in the packaged game: keep Cook Model on (section 16).

For lines you know beforehand, Generate Audio is better: no CPU in the game, the same result on every machine, and you can listen to every line before you ship.

Event OnNameEntered (Name)
  └─ NV Voice → Speak Text (Text = Format("Welcome, {0}. We were waiting for you.", Name), Priority = Important)

14. Customizing and extending

Hooks – override them in a Blueprint child of the component (Add > Blueprint Class > NV Voice / NV Conversation, then Functions > Override) or in C++ (_Implementation):

Hook Component Default Use it for
Can Speak (Event, Priority) NV Voice true Asleep, gagged, dead, a cutscene playing, muted by your stealth system.
Can Talk To (Player) NV Conversation true Busy, hostile, in combat, needs a quest stage.
Is Topic Available (Player, Topic) NV Conversation true; Once topics until asked Quest stages, items, reputation.
On Topic Chosen (Player, Topic) NV Conversation nothing Give a quest, open a shop, give an item.

Events to bind: NV Voice On Line Started / Finished; NV Conversation On Conversation Started / Ended, On Topic.

Look – duplicate /NPCVoice/Look/DA_NV_DefaultStyle (or create an NVStyle data asset) and select it in the settings:

Style property Default
Subtitle Font, Speaker Font Roboto 20 / bold 20
Subtitle Color, Speaker Color warm white / amber
Subtitle Background black 55 %, rounded A Slate brush (colour or texture).
Subtitle Bottom 0.1 Distance from the bottom, fraction of the screen height.
Wheel Font Roboto bold 17
Wheel Color, Wheel Highlight, Wheel Text Color dark / amber / warm white
Wheel Radius 170 Outer radius in Slate units.
Wheel Center 0.5, 0.63 Fraction of the screen; below the middle so the character’s face stays visible.

Your own UI

  • Subtitles: turn the built-in ones off (Show Subtitles), bind On Line Started (text, duration) and On Line Finished of the NV Voices you care about, and show them in your UMG widget.
  • Dialogue: keep NV Conversation for the logic and draw your own list: Get NVConversationSubsystem > Is In Conversation tells you when to show it, and Choose Topic (Index) says entry Index (the topics in order, the last one = goodbye). Hide the built-in wheel by making the style’s colours transparent, or skip NV Conversation and call Speak Line on the two NV Voices yourself.

Your own speech logic in C++ – add "NPCVoice" to your module’s PublicDependencyModuleNames, then:

#include "NVVoiceComponent.h"
#include "NVVoiceSubsystem.h"

// Say a line from your AI
if (UNVVoiceComponent* Voice = Npc->FindComponentByClass<UNVVoiceComponent>())
{
    Voice->SpeakEvent(TEXT("Alert"), ENVSpeechPriority::Important);
}

// Make speech yourself (e.g. to write a WAV)
FNVVoiceSettings Settings;
Settings.Voice = TEXT("bf_emma");
UNVVoiceSubsystem::Get()->SynthesizeAsync(TEXT("Hello there."), Settings, [](TSharedPtr<FNVSpeech> Speech)
{
    if (Speech) { FFileHelper::SaveArrayToFile(Speech->ToWav(), *(FPaths::ProjectSavedDir() / TEXT("hello.wav"))); }
});

15. Saving and loading

Nothing of NV Voice needs saving: the lines are assets. Two things live only for the play session:

  • Asked topics (for Once topics): save them yourself if they must survive a reload – check Was Asked (Topic Id) for your topic ids when saving, and on load mark them again in your own data (or keep the quest logic in Is Topic Available using your own save). Reset Asked Topics clears them.
  • Cooldowns and the last line said start fresh on load, which is what players expect.

16. Project settings reference

Project Settings > Plugins > NPC Voice (saved in Config/DefaultGame.ini).

Setting Default Meaning
Model
Model NV_Kokoro The voice model.
Cook Model on Put the model into packaged games (needed by Speak Text and NV.SelfTest). Off = about 360 MB smaller builds when the game only plays generated lines.
Pronunciation
Pronunciations empty Words every character says this way (section 8).
Playback
Attenuation built-in 3D falloff of all voices; default clear to 20 m, gone at 40 m.
Sound Class none For your mixer / volume options.
Pause Between Lines 0.4 s Rest after a character’s line before its next Normal one (Idle waits 4×).
Subtitles
Show Subtitles on
Subtitle Range 1500 cm Lines further from the player are not subtitled (conversations always are).
Conversation
Talk Keys E, Gamepad Face Button Left Open the wheel.
Player Voice Lines VL_Player The player’s voice when the pawn has no NV Voice.
Talk Range 300 cm How close to start a conversation.
Look
Style DA_NV_DefaultStyle Section 14.

17. Blueprint / C++ API reference

NV Voice (UNVVoiceComponent) – section 9.

Member Signature
Speak Event bool SpeakEvent(FName Event, ENVSpeechPriority Priority = Normal)
Speak Line bool SpeakLine(FName LineId, ENVSpeechPriority Priority = Normal)
Speak Text bool SpeakText(const FText& Text, ENVSpeechPriority Priority = Normal)
Speak Sound bool SpeakSound(USoundBase* Sound, const FText& Subtitle, ENVSpeechPriority Priority = Normal)
Stop Speaking void StopSpeaking()
Is Speaking bool IsSpeaking() const
Get Mouth Open float GetMouthOpen() const – 0..1
Get Current Text / Get Speaker Name FText ...() const
Get Time Left float GetTimeLeft() const – seconds
Can Speak (hook) bool CanSpeak(FName Event, ENVSpeechPriority Priority) const
On Line Started (UNVVoiceComponent* Voice, const FText& Text, float Duration)
On Line Finished (UNVVoiceComponent* Voice, bool bInterrupted)

ENVSpeechPriority: Idle, Normal, Important, Critical.

NV Conversation (UNVConversationComponent) – section 11.

Member Signature
Start Conversation bool StartConversation(APawn* Player)
Was Asked bool WasAsked(FName TopicId) const
Reset Asked Topics void ResetAskedTopics()
Can Talk To (hook) bool CanTalkTo(APawn* Player) const
Is Topic Available (hook) bool IsTopicAvailable(APawn* Player, const FNVTopic& Topic) const
On Topic Chosen (hook) void OnTopicChosen(APawn* Player, const FNVTopic& Topic)
On Conversation Started / Ended (APawn* Player)
On Topic (APawn* Player, const FNVTopic& Topic)

NV Conversation Subsystem (UNVConversationSubsystem, world subsystem; Get NVConversationSubsystem)

Member Signature
Is In Conversation bool IsInConversation() const
Get Conversation Partner UNVConversationComponent* GetConversationPartner() const
Choose Topic void ChooseTopic(int32 Index) – the last index = goodbye
End Conversation void EndConversation()

NV Subtitle Subsystem (UNVSubtitleSubsystem, world subsystem): void SetSubtitlesEnabled(bool bEnabled).

NV Voice Library (UNVVoiceLibrary, Blueprint function library)

Function Signature
Preload Voice Model static void PreloadVoiceModel()
Text To Phonemes static FString TextToPhonemes(const FString& Text, const FNVVoiceSettings& Voice)
Get Voice Options static TArray<FString> GetVoiceOptions() – the 28 voice names

NV Voice Lines (UNVVoiceLines): TArray<FName> GetEvents() const; C++ const FNVLine* FindLine(FName Id), const FNVLine* PickLine(FName Event, FName Avoid); editor GenerateAudio(), RegenerateAll().

NV Voice Subsystem (UNVVoiceSubsystem, engine subsystem, C++ only; UNVVoiceSubsystem::Get())

Member Meaning
bool EnsureReady(FString* OutError) Loads the model now (about a second).
void Preload(TFunction<void(bool)> Done) The same in the background.
bool Synthesize(Text, Settings, FNVSpeech& Out, FString* OutError) Text → speech on this thread (thread safe after EnsureReady).
void SynthesizeAsync(Text, Settings, TFunction<void(TSharedPtr<FNVSpeech>)> Done) On a worker; Done on the game thread.
FString Phonemize(Text, Settings, TArray<FString>* OutUnknown) The phonemes, and the words read by rules.
static USoundWaveProcedural* MakeSound(UObject* Outer, const FNVSpeech&) A playable sound.
static TArray<uint8> MakeMouthCurve(Samples, SampleRate) The mouth curve.

FNVSpeech: Samples (float, 24 kHz mono), SampleRate, Mouth, Phonemes, UnknownWords, GetDuration(), ToWav() (16-bit PCM file bytes).

Data: FNVVoiceSettings (Voice, BlendVoice, BlendAmount, Speed, Pitch, Volume, Pronunciations) – section 6; FNVLine – section 7; FNVTopic – section 11.

Anim node: FAnimNode_NVVoiceJaw (“NV Voice Jaw”) – section 12.

Modules: NPCVoice (Runtime: everything above) and NPCVoiceEditor (Editor: Generate Audio, Preview, the anim graph node, the commandlets).

18. Console commands

Command Does
NV.Talk Talks to the nearest talkable character. NV.Talk 2 then chooses the second wheel entry.
NV.Say <name> <event or line id> A character (actor name or label, part of it is enough) says a line: NV.Say Guard Alert.
NV.Say <name> text <words...> A character says any text, made now.
NV.SelfTest [quit] Loads the model, makes and plays a test sentence, logs [SelfTest] OK with the timings. quit closes the game after it.
log LogNPCVoice Verbose Every line said, with its length.

Commandlets for batch work (UnrealEditor-Cmd.exe <Project>.uproject -run=<name> ...):

Commandlet Does
NVVoiceTest -lines=/Game/Path/VL_Name.VL_Name [-all] Generate Audio for a lines asset (all lines with -all) and save – e.g. on a build machine.
NVVoiceTest -say="text" -voice=af_heart [-pitch= -speed= -blend=] -out=file.wav Writes one WAV.

19. Performance and size

  • Generated lines are plain SoundWaves: no model, no CPU beyond normal audio. NV Voice ticks only while speaking; the ambient checks run 2.5 times a second when Greet Distance or Idle Range are set.
  • Speak Text: about 0.1-0.2 s of CPU per second of speech on one worker thread; about 400 MB of memory while the model is loaded (it stays loaded once used). Measured in a packaged Development build: model loaded in 0.8 s, the first sentence (5.9 s of speech, including preparing the pronunciation data) in 3.6 s.
  • In the editor: Generate Audio ≈ a tenth of the line’s length per line.
  • Size: the model asset ~325 MB (full precision; the half-precision variant gives silence on some inputs, so it is not used), the voices and dictionaries ~37 MB. In a packaged game about 320 MB (cooked for the CPU runtime only), or nothing with Cook Model off.

20. Packaging your game

  1. Speak Text used? Keep Cook Model on: the plugin adds /NPCVoice/Model to the cook by itself. Otherwise turn it off: about 360 MB smaller.
  2. Generated lines are cooked like every referenced asset. Lines referred to only by name from C++ must be referenced by an asset or a map that is cooked (as usual in Unreal).
  3. Check the packaged game: start it with -ExecCmds="NV.SelfTest" (or type NV.SelfTest in its console) and look for [SelfTest] OK in Saved/Logs/<Game>.log. With Cook Model off it says “No voice model”, which is expected.
  4. Windows 64-bit only. No extra DLLs: ONNX Runtime comes with the engine’s NNERuntimeORT plugin.

21. Troubleshooting

Generate Audio says “No voice model”. Project Settings > Plugins > NPC Voice > Model must be NV_Kokoro.

“The NNERuntimeORTCpu runtime is not available”. Enable NNERuntimeORT in Edit > Plugins and restart.

A name sounds wrong. Add it to Pronunciations (section 8), then Regenerate All. The notification after Generate Audio lists the words read by rules.

A line is not said. The request was refused: busy with a line of the same or higher priority, a cooldown, a pause after the last line, no line for that event, or the line has no audio yet (Generate Audio). The Speak functions return false then; log LogNPCVoice Verbose lists every line that was said. Use Important for lines that must be heard.

Greetings repeat too often / never. Event Cooldowns (Greeting 20 s) and Greet Distance; a greeting comes again only after the player left the distance.

No subtitles. Show Subtitles in the settings, the character’s Subtitles, and Subtitle Range.

The “Talk to” prompt does not show. The actor needs NV Conversation with a Conversation, and an NV Voice; the player must be within Talk Range and face the character; Can Talk To must return true.

The player’s questions are silent. The pawn has no NV Voice and Player Voice Lines is empty – or the topic’s Player Line names no event / id of those lines.

The mouth does not move. Morph target: the name must exist on the mesh (case matters). Jaw node: the actor that owns the mesh (or its parent) needs NV Voice; check Jaw Bone and Open Rotation; try Mouth Override = 1 in the preview.

The first Speak Text hitches / is late. Call Preload Voice Model at level start.

Packaged game: “No voice model”. Cook Model is off, or the model was removed from the cook.

22. Known limitations

  • English only (American and British). Very long texts are split at sentence ends (about 500 phonemes per piece).
  • The mouth follows loudness (open / closed), not visemes.
  • The pitch shift sounds best within ±3 semitones.
  • No voice cloning from recordings.
  • Multiplayer: lines play where they are triggered; call Speak on every client (e.g. from a multicast event) if all players should hear them.
  • Windows 64-bit only in this version.

23. Support, licences and credits

  • Support: lozanalekseev@gmail.com (also the Support link on the Fab page and in Edit > Plugins).
  • The plugin is distributed under the Fab End User License Agreement (Standard License).
  • Third-party software (licence texts in Docs/ThirdPartyNotices.md):
  • Kokoro-82M v1.0 by hexgrad – Apache-2.0 – the voice model (weights and voices).
  • onnx-community/Kokoro-82M-v1.0-ONNX – Apache-2.0 – the ONNX export of the model.
  • misaki by hexgrad – Apache-2.0 – the English pronunciation dictionaries; the G2P code is a C++ port of it.
  • The part-of-speech tagger was trained for this plugin on public-domain books (Project Gutenberg). The demo character, materials and map were made for this plugin.
  • No espeak or other GPL software is used or included.
  • Made with the help of AI (Claude by Anthropic) – the code, the documentation and the tools were written together with an AI agent, directed and tested by the author.