mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-11-22 16:45:56 +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();
|
let message = message.to_string();
|
||||||
if let Ok(id) = self.0.speak(message, interrupt) {
|
if let Ok(id) = self.0.speak(message, interrupt) {
|
||||||
let utterance: Instance<Utterance, Unique> = Instance::new();
|
let utterance: Instance<Utterance, Unique> = Instance::new();
|
||||||
|
if id.is_some() {
|
||||||
utterance
|
utterance
|
||||||
.map_mut(|u, _| u.0 = id)
|
.map_mut(|u, _| u.0 = id)
|
||||||
.expect("Failed to set utterance ID");
|
.expect("Failed to set utterance ID");
|
||||||
|
}
|
||||||
Some(utterance.owned_to_variant())
|
Some(utterance.owned_to_variant())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user