From c92b67127ca621ea27e241bf0f192ff520d9155a Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 30 Dec 2020 10:15:37 -0600 Subject: [PATCH] Support is_speaking. --- src/backends/android.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backends/android.rs b/src/backends/android.rs index 6060d83..a1c5d07 100644 --- a/src/backends/android.rs +++ b/src/backends/android.rs @@ -121,7 +121,7 @@ impl Backend for Android { rate: true, pitch: true, volume: false, - is_speaking: false, + is_speaking: true, utterance_callbacks: false, } } @@ -253,6 +253,11 @@ impl Backend for Android { } fn is_speaking(&self) -> Result { - todo!() + let vm = Self::vm()?; + let env = vm.get_env()?; + let tts = self.tts.as_obj(); + let rv = env.call_method(tts, "isSpeaking", "()Z", &[])?; + let rv = rv.z()?; + Ok(rv) } }