'Google TTS getFeatures() Incorrect Results

I have an issue with Google TTS, when I call getVoices() then call getFeatures () on the returned Voices sometimes the returned string contains "notInstalled" on every Voice even when the voice is installed on the device.

For Example - Voice[Name: en-US-language, locale: en_US, quality: 400, latency: 200, requiresNetwork: false, features: [networkTimeoutMs, legacySetLanguageVoice, networkRetriesCount, notInstalled]]

This happens on Android Marshmallow and Android 12 and possibly others. I have to call the same function several times before I get the true results. This doesn't happen every time just occasionally.

Any helpful suggestions would be greatly appreciated.

PS: I call the function after TextToSpeech.SUCCESS in onInit.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source