Godot Text to Speech is a plugin that creates text-to-speech voice synthesis in the Godot engine using the FOSS Flite engine.
This plugin was originally developed for use in Strange Aeons, a game where you chat with a neural net AI.
Once the plugin is installed and enabled the node types TextToSpeech, TextToSpeech2D & TextToSpeech3D should appear in the Godot engine. Add one of them to your scene and use the example below as a guideline.
In the example project shown below the the phrase Text to speech is a really neat thing.
is said upon launch in all the available voices.
extends Node2D
func _ready():
var text = "Text to speech is a really neat thing."
var speed = 0.9
yield($TextToSpeech.say(text, TextToSpeechEngine.VOICE_AWB, speed), "completed")
yield($TextToSpeech.say(text, TextToSpeechEngine.VOICE_AHW, speed), "completed")
yield($TextToSpeech.say(text, TextToSpeechEngine.VOICE_FEM, speed), "completed")
yield($TextToSpeech.say(text, TextToSpeechEngine.VOICE_AEW, speed), "completed")
yield($TextToSpeech.say(text, TextToSpeechEngine.VOICE_SLT, speed), "completed")
yield($TextToSpeech.say(text, TextToSpeechEngine.VOICE_EEY, speed), "completed")
yield($TextToSpeech.say(text, TextToSpeechEngine.VOICE_CLB, speed), "completed")
Linux:
- Run
make
in the src directory
Windows:
- Install MinGW-w64 on your system
- Run
mingw32-make
in the src directory
- The current implementation is intended to have a small (optimally one) TextToSpeech node in the scene as the dynamic library is loaded for each instance