mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-12-22 12:05: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():
|
||||
# Only initialize TTS if it's available or if we're in the editor.
|
||||
if TTS.can_instance() or Engine.editor_hint:
|
||||
print("Attempting to load TTS.")
|
||||
print_debug("Attempting to load TTS.")
|
||||
tts = TTS.new()
|
||||
else:
|
||||
print("TTS not available!")
|
||||
print_debug("TTS not available!")
|
||||
|
||||
func set_rate(rate):
|
||||
if tts != null:
|
||||
|
@ -26,6 +26,7 @@ func get_rate():
|
|||
var rate setget set_rate, get_rate
|
||||
|
||||
func speak(text, interrupt := true):
|
||||
print_debug("%s: %s" % [text, interrupt])
|
||||
if tts != null:
|
||||
tts.speak(text, interrupt)
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@ impl TTS {
|
|||
#[export]
|
||||
fn speak(&mut self, _owner: Node, message: GodotString, interrupt: bool) {
|
||||
let message = message.to_string();
|
||||
println!("{}: {}", message, interrupt);
|
||||
self.0.speak(message, interrupt).unwrap();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user