Code example for TextToSpeech

Methods: isLanguageAvailablesetLanguage

	public void onInit(int initStatus) {
        //check for successful instantiation 
		if (initStatus == TextToSpeech.SUCCESS) {
		else if (initStatus == TextToSpeech.ERROR) {
			Toast.makeText(this, "Sorry! Text To Speech failed...", Toast.LENGTH_LONG).show();
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == MY_DATA_CHECK_CODE) {
            if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
                //the user has the necessary data - create the TTS 
            myTTS = new TextToSpeech(this, this);
Stop searching for code, let great code find you!  Add Codota to your java IDE