mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-11-22 20:35:56 +00:00
Only print TTS output if we aren't speaking.
This commit is contained in:
parent
735c7ebfa6
commit
be52e4c6ae
3
TTS.gd
3
TTS.gd
|
@ -36,7 +36,6 @@ func get_rate():
|
||||||
var rate setget set_rate, get_rate
|
var rate setget set_rate, get_rate
|
||||||
|
|
||||||
func speak(text, interrupt := true):
|
func speak(text, interrupt := true):
|
||||||
print_debug("%s: %s" % [text, interrupt])
|
|
||||||
if tts != null:
|
if tts != null:
|
||||||
tts.speak(text, interrupt)
|
tts.speak(text, interrupt)
|
||||||
elif OS.has_feature('JavaScript'):
|
elif OS.has_feature('JavaScript'):
|
||||||
|
@ -51,6 +50,8 @@ func speak(text, interrupt := true):
|
||||||
"""
|
"""
|
||||||
code += "window.speechSynthesis.speak(utterance)"
|
code += "window.speechSynthesis.speak(utterance)"
|
||||||
JavaScript.eval(code)
|
JavaScript.eval(code)
|
||||||
|
else:
|
||||||
|
print_debug("%s: %s" % [text, interrupt])
|
||||||
|
|
||||||
func stop():
|
func stop():
|
||||||
if tts != null:
|
if tts != null:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user