mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-11-22 11:45:57 +00:00
Only set an utterance ID on the returned variant if we have one.
This commit is contained in:
parent
ed7f3920f6
commit
ff247a3f19
|
@ -178,9 +178,11 @@ impl TTS {
|
|||
let message = message.to_string();
|
||||
if let Ok(id) = self.0.speak(message, interrupt) {
|
||||
let utterance: Instance<Utterance, Unique> = Instance::new();
|
||||
utterance
|
||||
.map_mut(|u, _| u.0 = id)
|
||||
.expect("Failed to set utterance ID");
|
||||
if id.is_some() {
|
||||
utterance
|
||||
.map_mut(|u, _| u.0 = id)
|
||||
.expect("Failed to set utterance ID");
|
||||
}
|
||||
Some(utterance.owned_to_variant())
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Reference in New Issue
Block a user