From d3b90f48e7bcb4adad94425458ce23af3d7860f9 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 18 Aug 2020 13:50:32 -0500 Subject: [PATCH] Use deprecated API so compatibility down to 18 can be maintained. --- src/main/java/games/lightsout/godot/tts/TTS.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/games/lightsout/godot/tts/TTS.java b/src/main/java/games/lightsout/godot/tts/TTS.java index 8d95276..582eb3e 100644 --- a/src/main/java/games/lightsout/godot/tts/TTS.java +++ b/src/main/java/games/lightsout/godot/tts/TTS.java @@ -1,6 +1,7 @@ package games.lightsout.godot.tts; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import org.godotengine.godot.Godot; @@ -17,14 +18,15 @@ public class TTS extends GodotPlugin implements TextToSpeech.OnInitListener { private float rate = 1f; - private Integer utteranceId = 0; + // private Integer utteranceId = 0; public void speak(String text, boolean interrupt) { int mode = TextToSpeech.QUEUE_ADD; if (interrupt) mode = TextToSpeech.QUEUE_FLUSH; - tts.speak(text, mode, null, this.utteranceId.toString()); - this.utteranceId++; + HashMap params = new HashMap(); + tts.speak(text, mode, params); + // this.utteranceId++; } public void stop() { @@ -61,10 +63,12 @@ public class TTS extends GodotPlugin implements TextToSpeech.OnInitListener { this.tts = new TextToSpeech(this.getActivity(), this); } + @Override public String getPluginName() { return "GodotTTS"; } + @Override public List getPluginMethods() { return Arrays.asList("speak", "stop", "get_rate", "set_rate", "has_screen_reader", "is_speaking"); }