Reputation: 628
I am using below library for TextToSpeech functionality to speak something -
'net.gotev:speech:1.3.1'
Now I need to change its accent for all country as US English I tried -
Speech.getInstance().setLocale(Locale.US);
but it is not working, please guide me.
With the help of below code I am trying to let it speak a word -
Speech.getInstance().say("Hello", new TextToSpeechCallback() {
@Override
public void onStart() {
}
@Override
public void onCompleted() {
}
@Override
public void onError() {
}
});
Now it actually speaks in locale based English accent for example - if it is run by Russian user then due to its locale it speaks this English in Russian accent but I want that it should be spoken in US ENGLISH accent rather than its locale based accent
Upvotes: 2
Views: 228
Reputation: 7437
After looking at the code of that library, I think you would be much better off just working with the standard Android TextToSpeech object.
Using the normal TextToSpeech, doing what you are trying to do could be as simple as:
TextToSpeech tts = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int i) {
tts.setLanguage(Locale.US);
tts.speak("Hello", TextToSpeech.QUEUE_FLUSH, null);
}
});
PROBLEMS I SEE WITH THAT LIBRARY:
Upvotes: 2