Code example for TextToSpeech

Methods: setLanguage

0
		Log.v(tag, Logging.getCurrentMethodName(status));
		if (status != TextToSpeech.SUCCESS) {
			Log.e(tag, "TTS not avaliable!");
			android.os.Process.killProcess(android.os.Process.myPid());
		} else { 
			tts.setLanguage(Locale.UK);
			AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
			int amStreamMusicMaxVol = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
			am.setStreamVolume(AudioManager.STREAM_SYSTEM,
					(int) ((double) amStreamMusicMaxVol * 2.0), 0);
		} 
	} 
}