Text to speech for game development: NPC voices without a studio
Indie games and prototypes need hundreds of voice lines long before there is a budget for actors: NPC barks, tutorial prompts, quest dialogue, announcer calls. Text to speech fills that gap: change a line in the script, regenerate the audio, rebuild the game.
This guide shows how to do it with Supertonic 3 and the free SuperClonica engine, which runs offline on developer machines and build servers, and how to get voices you are allowed to ship.
Why offline TTS suits game development
A game needs voice lines that change with the script, many times, on every machine of the team.
- No per-character fees: regenerate every line as often as the script changes.
- Runs on an ordinary processor, so it fits build machines without graphics cards.
- The same voice file gives the same timbre every time, so lines recorded weeks apart still match.
- 31 languages from one voice, handy for localization prototypes.
Generate lines in batches
Install the engine with python -m pip install superclonica-cpu and keep your lines in a simple table: an id, the language and the text. A short Python or shell script can loop over it and call superclonica --text "..." --voice npc.json --lang en --output lines/npc_greeting_01.wav for each row. Commit the script, not the audio, and regenerate the WAV files in your build.
Our guides on text to speech in Python and on a self-hosted API in Docker show how to call the engine from code or as an HTTP service for editor tools.
Import into Unity, Godot or Unreal
The engine writes standard WAV files, which every engine imports as audio clips. Name files by line id so your dialogue system can find them, and keep lines short: one or two sentences per file are easier to time, subtitle and redo.
Voices you can ship
For prototypes, any catalog voice is fine to listen to your script. For a released game, use a voice you have the rights to: train your own from a clean 5 to 10 second recording of an actor who agreed, in the studio on a computer with an NVIDIA graphics card, or order a custom voice on the exchange. Fan-made character and celebrity voices are for parody and fan works, not for commercial games.
Make NPC lines sound alive
Write lines the way people speak, with punctuation for rhythm: an exclamation mark for a shout, an ellipsis for hesitation, a question mark for a rising tone. Give each NPC type its own voice and keep a pronunciation list for names in your world.