Implement utterance_stop signal on Android.

This commit is contained in:
Nolan Darilek 2020-10-08 11:10:16 -05:00
parent f105ee702b
commit 9243ea4e7f

View File

@ -67,6 +67,11 @@ public class TTS extends GodotPlugin implements TextToSpeech.OnInitListener {
TTS.this.emitSignal("utterance_begin", id); 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) { public void onDone(String utteranceId) {
Integer id = Integer.parseInt(utteranceId); Integer id = Integer.parseInt(utteranceId);
TTS.this.emitSignal("utterance_end", id); TTS.this.emitSignal("utterance_end", id);
@ -98,7 +103,8 @@ public class TTS extends GodotPlugin implements TextToSpeech.OnInitListener {
public Set<SignalInfo> getPluginSignals() { public Set<SignalInfo> getPluginSignals() {
SignalInfo begin = new SignalInfo("utterance_begin", Integer.class); SignalInfo begin = new SignalInfo("utterance_begin", Integer.class);
SignalInfo end = new SignalInfo("utterance_end", 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) { public void onInit(int status) {