Code example for TextToSpeech

Methods: equals, setLanguage, speak

0
	} 
 
	private void startTTS() { 
		initNotification(); 
		running = true;
		tts.setLanguage(Locale.UK);
		HashMap<String, String> hashRender = new HashMap<String, String>();
		hashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "play_id");
		if (!tts.equals("")) {
			tts.speak(ttsText, TextToSpeech.QUEUE_FLUSH, hashRender);
		} 
	} 
 
	private void initNotification() { 
		int icon = R.drawable.ic_launcher;
		long when = System.currentTimeMillis();
		Notification notification = new Notification(icon, null, when);
 
		Context context = getApplicationContext();
		CharSequence contentTitle = String.valueOf("Plaing audio");
		Intent mintent = new Intent(getApplicationContext(), ThingDetailActivity.class);