Kaifi Girdhar
Kaifi Girdhar

Reputation: 471

Get selected language of default TTS

I have implemented tts in my android app. It supports all languages which is supported by default TTS in android device. But is it possible to get the name of language which is selected in default TTS i.e name of language which is selected in Google TTS in the Settings?

Upvotes: 2

Views: 1306

Answers (2)

Alexis Pigeon
Alexis Pigeon

Reputation: 7512

Until API 18, you would have to use getLanguage().

In API 18 getDefaultLanguage() was introduced.

And starting with API 21, you should use getDefaultVoice().getLocale().

Upvotes: 5

Confuse
Confuse

Reputation: 5786

Use this -

Locale.getDefault().getDisplayLanguage();

Upvotes: 0

Related Questions