extends Node2D
var STT
func _ready():
if Engine.has_singleton("SpeechToText"):
STT = Engine.get_singleton("SpeechToText")
STT.setLanguage("en")
STT.connect("error",self,"_on_error")
STT.connect("listening_completed", self, "_on_listening_completed")
pass
func _on_listening_completed(args):
print(args)
$TextEdit.text = str(args)
func _on_error(errorcode):
print("Error: " + errorcode)
func _on_Listen_button_down():
print("listening")
STT.listen()
pass
func _on_Stop_button_down():
print("stop")
STT.stop()
pass
func _on_GetOutput_button_down():
var words = STT.getWords()
$TextEdit2.text = words
pass
func _on_Stop_button_up():
print("stop")
STT.stop()
pass
i have this error every time i click any buttons please help me.