Code example for TextToSpeech

Methods: getDefaultEnginegetLanguagesetOnUtteranceCompletedListener

0
 
	public void onInit(int status) {
		// Now that the TTS engine is ready, we enable the button 
		if( status == TextToSpeech.SUCCESS) {
			speakBtn.setEnabled(true);
			Locale loc = mTts.getLanguage();
            Log.v(TAG, "default engine: " + mTts.getDefaultEngine());
            Log.v(TAG, "current language/locale: " + loc.getDisplayName());
            Log.v(TAG, "current ISO3 language: " + loc.getISO3Language());
            Log.v(TAG, "current ISO3 country: " + loc.getISO3Country());
            Log.v(TAG, "current language: " + loc.getLanguage());
            Log.v(TAG, "current country: " + loc.getCountry());
            // mTts.setLanguage(new Locale("fr")); 
			mTts.setOnUtteranceCompletedListener(this);
		} 
	} 
 
	@Override 
	public void onPause() 
	{ 
Contextual code suggestions in your IDE  Get Codota for Java