Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. package com.byteshelter.test02;
  2.  
  3. import android.speech.tts.TextToSpeech;
  4. import android.support.v7.app.AppCompatActivity;
  5. import android.os.Bundle;
  6.  
  7. import java.util.Locale;
  8.  
  9. public class MainActivity extends AppCompatActivity {
  10.  
  11.     private TextToSpeech tts;
  12.  
  13.     @Override
  14.     protected void onCreate(Bundle savedInstanceState) {
  15.         super.onCreate(savedInstanceState);
  16.         setContentView(R.layout.activity_main);
  17.         tts = new TextToSpeech(this, this);      // this is where the error occourse
  18.     }
  19.  
  20.     @Override
  21.     public void onInit(int argv) {
  22.  
  23.         tts.setLanguage(Locale.GERMAN);
  24.         tts.speak("Hello", TextToSpeech.QUEUE_FLUSH, NULL);
  25.     }
  26.  
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement