Reputation: 29
I m making a quiz type app.
I want that when the user types the correct or incorrect answer, the user should be informed through spoken voice in addition to display.
how can we implement this thing in android?
Upvotes: 1
Views: 414
Reputation: 7717
I think you need the TextToSpeech functionnality provided by android (Added in API level 4) http://developer.android.com/reference/android/speech/tts/TextToSpeech.html
TextToSpeech ttobj=new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
}
}
);
ttobj.setLanguage(Locale.UK);
and finally
ttobj.speak(text, TextToSpeech.QUEUE_FLUSH, null);
Upvotes: 1
Reputation: 38098
So you want a tutorial on TTS (Text To Speech).
Here's one.
Upvotes: 1