From 9243ea4e7fc02f5a0c870941dae680ffe208f6ba Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 8 Oct 2020 11:10:16 -0500 Subject: [PATCH] Implement utterance_stop signal on Android. --- src/main/java/games/lightsout/godot/tts/TTS.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/games/lightsout/godot/tts/TTS.java b/src/main/java/games/lightsout/godot/tts/TTS.java index 4617a4c..ecbe9f0 100644 --- a/src/main/java/games/lightsout/godot/tts/TTS.java +++ b/src/main/java/games/lightsout/godot/tts/TTS.java @@ -67,6 +67,11 @@ public class TTS extends GodotPlugin implements TextToSpeech.OnInitListener { TTS.this.emitSignal("utterance_begin", id); } + public void onStop(String utteranceId, Boolean interrupted) { + Integer id = Integer.parseInt(utteranceId); + TTS.this.emitSignal("utterance_stop", id); + } + public void onDone(String utteranceId) { Integer id = Integer.parseInt(utteranceId); TTS.this.emitSignal("utterance_end", id); @@ -98,7 +103,8 @@ public class TTS extends GodotPlugin implements TextToSpeech.OnInitListener { public Set getPluginSignals() { SignalInfo begin = new SignalInfo("utterance_begin", Integer.class); SignalInfo end = new SignalInfo("utterance_end", Integer.class); - return new HashSet(Arrays.asList(begin, end)); + SignalInfo stop = new SignalInfo("utterance_stop", Integer.class); + return new HashSet(Arrays.asList(begin, end, stop)); } public void onInit(int status) {