Android Question SOLVED - Check if TTS is available / enabled on device (TTSID)


Licensed User

I have an app that use SpeechRecognition and TTS functionality : I use TTSID and SpeechRecognition_NoUi Libraries.
My app work perfectly if the device have SR and TTS enabled by defaut, which is the case for most android devices, especially those with Google services enabled.
If this is not the case (I notice this with cheap Android Tablets for ex..) , the user have to install « Google » app and « Google voice » in Google Play.

At the first start of app, I want to check if TTS and SR are enabled on the device. If yes: activate TTS and SR functionalities, If no disable them.

For Speech recognition: it’s ok.

I can do it well with SpeechRecognition_NoUi library, it’s contain a native function to test it:

If sr.IsRecognitionAvailable Then
        'Enable SR functionalities in the app
        'disable SR functionalites in the app
    End If

I want to do it also for TTSID. I test it on device wich have no tts enabled or installed.

And it naturally give me an error:

java.lang.RuntimeException: java.lang.RuntimeException: Error speaking text.
at anywheresoftware.b4a.keywords.Common$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)
Caused by: java.lang.RuntimeException: Error speaking text.
at anywheresoftware.b4a.obejcts.TTS.Speak(
at b4a.example.ttsid._vv7(

... 7 more

How can I check if TTS is available on device/ installed , the same as i do with SR function ( a kind of tts.isTTSAvailable function) ?

Thank you for your help.
Last edited:


Licensed User
I solve my problem by adding this check :

If TTS.GetEngines.Size > 0 Then
        TTS.Speak("bla bla", True)
End If

I make it as solved.
Last edited:
Upvote 0