mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-11-22 15:45:57 +00:00
Use print_debug
to, theoretically, only print TTS speech/interrupt status when in debug mode.
And yet it still prints in exported builds not using the debug templates. *sigh*
This commit is contained in:
parent
ec99d318d3
commit
e233b97fff
5
TTS.gd
5
TTS.gd
|
@ -8,10 +8,10 @@ var tts = null
|
||||||
func _ready():
|
func _ready():
|
||||||
# Only initialize TTS if it's available or if we're in the editor.
|
# Only initialize TTS if it's available or if we're in the editor.
|
||||||
if TTS.can_instance() or Engine.editor_hint:
|
if TTS.can_instance() or Engine.editor_hint:
|
||||||
print("Attempting to load TTS.")
|
print_debug("Attempting to load TTS.")
|
||||||
tts = TTS.new()
|
tts = TTS.new()
|
||||||
else:
|
else:
|
||||||
print("TTS not available!")
|
print_debug("TTS not available!")
|
||||||
|
|
||||||
func set_rate(rate):
|
func set_rate(rate):
|
||||||
if tts != null:
|
if tts != null:
|
||||||
|
@ -26,6 +26,7 @@ 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)
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ impl TTS {
|
||||||
#[export]
|
#[export]
|
||||||
fn speak(&mut self, _owner: Node, message: GodotString, interrupt: bool) {
|
fn speak(&mut self, _owner: Node, message: GodotString, interrupt: bool) {
|
||||||
let message = message.to_string();
|
let message = message.to_string();
|
||||||
println!("{}: {}", message, interrupt);
|
|
||||||
self.0.speak(message, interrupt).unwrap();
|
self.0.speak(message, interrupt).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user