godot-tts/TTS.gd

18 lines
297 B
GDScript

extends Node
const TTS = preload("godot-tts.gdns")
var tts = TTS.new()
func speak(text, interrupt := true):
tts.speak(text, interrupt)
func stop():
tts.stop()
func singular_or_plural(count, singular, plural):
if count == 1:
return singular
else:
return plural