Search This Blog

Sunday, March 20, 2016

DOC TEXT - TEXT TO SPEED

TextToSpeech t1;

@Override

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);



    t1=new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {

        @Override

        public void onInit(int status) {

            if(status != TextToSpeech.ERROR) {

                t1.setLanguage(Locale.ENGLISH);

                t1.speak("I've been lonely with you", TextToSpeech.QUEUE_FLUSH, null)

            }

        }

    });

}

No comments:

Post a Comment