how can change this "Text To Speech Class" to spanish? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how can change this "Text To Speech Class" to spanish?

public class TextToSpeechClass { /* access modifiers changed from: private */ public final TextToSpeech mTTS; public TextToSpeechClass(Context context) { this.mTTS = new TextToSpeech(context, new OnInitListener() { public void onInit(int i) { String str = "Lang"; if (i == 0) { int language = TextToSpeechClass.this.mTTS.setLanguage(Locale.ENGLISH); if (language == -1 || language == -2) { Log.e(str, "lang not supported"); return; } return; } Log.e(str, "initialization failed"); } }); }

22nd Nov 2021, 8:57 PM
Juan
1 Answer
+ 2
chk your code int language = mTTS.setLanguage(Locale.ENGLISH); or int language = mTTS.setLanguage(Locale.getDefault());
22nd Nov 2021, 9:29 PM
SoloProg
SoloProg - avatar