Open
Description
Hey guys @hrishikesh-kadam @mahavir155,
Thank you for the great library!
Can you add ability to change language of speech for the book.
Currently in the project all our books have the german language. But your app reader reads on english pronunciation.
Questions:
- How to set/change the language of text-to-speech? I see that Locale.UK is default.
- Can we disable the speech button in some cases?
I found that you set the language in MediaController on next method:
public void setTextToSpeech(final Context context) {
mTextToSpeech = new TextToSpeech(context, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status != TextToSpeech.ERROR) {
mTextToSpeech.setLanguage(Locale.UK);
mTextToSpeech.setSpeechRate(0.70f);
}
mTextToSpeech.setOnUtteranceCompletedListener(
new TextToSpeech.OnUtteranceCompletedListener() {
@Override
public void onUtteranceCompleted(String utteranceId) {
((AppCompatActivity) context).runOnUiThread(new Runnable() {
@Override
public void run() {
if (mIsSpeaking) {
callbacks.highLightTTS();
}
}
});
}
});
}
});
}
Thank you!