Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.byteshelter.test02;
- import android.speech.tts.TextToSpeech;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import java.util.Locale;
- public class MainActivity extends AppCompatActivity {
- private TextToSpeech tts;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- tts = new TextToSpeech(this, this); // this is where the error occourse
- }
- @Override
- public void onInit(int argv) {
- tts.setLanguage(Locale.GERMAN);
- tts.speak("Hello", TextToSpeech.QUEUE_FLUSH, NULL);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement