GUIDE

Godot text to speech: voice lines and runtime speech

Godot games are often made by one person or a small team, and voice acting is the part that rarely fits the budget. Text to speech gives every line a voice the day it is written: for prototypes, placeholder dialogue, tutorials, and for games that keep a synthetic voice on purpose.

The free SuperClonica engine voices text offline on an ordinary processor. This guide shows the two ways to use it with Godot, pre-generated WAV files and runtime speech from GDScript, and which voices you can ship.

Two ways to give a Godot game a voice

A player’s computer will not run a speech server, so a released single-player game should ship the files.

  • Pre-generated files: voice every line during development and keep the WAV files in the project. They are exported with the game like any other sound.
  • Runtime speech: the game sends text to a SuperClonica server and plays the answer. It suits editor tools, prototypes and online games with their own server.
  • Either way, voicing runs on an ordinary processor, with no fee per character.
  • The model speaks 31 languages; Chinese is not supported yet.

Pick voices free online

On the page of any voice, type a line of your character, 30 to 100 characters, choose the language and press Voice it. In a few seconds you hear whether the voice fits, with no account.

Pre-generate the dialogue

The same text, voice and seed always give the same audio, so regenerate only the lines that changed and commit the script, not the audio.

  • Install the engine: python -m pip install superclonica-cpu.
  • Keep the lines in a table with an id, a language and the text.
  • A short script loops over it: superclonica --text "Welcome to the village!" --voice npc.json --lang en --output voice/npc_greeting_01.wav.
  • Godot imports new WAV files in the project on its own; play them with an AudioStreamPlayer.

Speak at runtime from GDScript

Start the server on any processor: docker run -d -p 8000:8000 -v superclonica-models:/models superclonica/superclonica:cpu. In Godot 4.4 or newer, the built-in HTTPRequest node and AudioStreamWAV.load_from_buffer play the answer without saving a file: var http := HTTPRequest.new(); add_child(http); http.request_completed.connect(_on_voice); http.request("http://localhost:8000/synthesize", ["Content-Type: application/json"], HTTPClient.METHOD_POST, JSON.stringify({"text": "Welcome back!", "voice": "F1", "lang": "en"})) — and in the same script: func _on_voice(result, code, headers, body): $Voice.stream = AudioStreamWAV.load_from_buffer(body); $Voice.play(). A short phrase takes about half a second on a processor; cache the streams of lines that repeat. Never put an API key into an exported game, where players can extract it: let your own game server call the speech server.

Voices you can ship

For prototypes, any catalog voice is fine. For a released game, use a voice you have the rights to: the ten stock voices of the model, M1 to M5 and F1 to F5, or your own voice trained in the SuperClonica studio from a clean 5 to 10 second recording of an actor who agreed, on a computer with an NVIDIA graphics card, or a custom voice ordered on the exchange. Fan-made character voices are for parody and fan games, not for commercial ones.