• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Text-To-Speech

GiantKruemel

Lurker
Feb 13, 2009
6
0
Hello everybody.
I'm trying to program an application that uses Text-To-Speech functionally.
I followed the tutorial at this page:
http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/tutorial.html

(Of course I didn t forget to run the virtual phone with the virtual sdcard and to add the TTS library)
Here is the code:

Code:
package wolf.android.hello;

import com.google.tts.TTS;

import android.app.Activity;
import android.os.Bundle;

public class hello extends Activity {
    private TTS myTts;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        myTts = new TTS(this, ttsInitListener, true);
    }
    
    private TTS.InitListener ttsInitListener = new TTS.InitListener() {
        public void onInit(int version) {
          myTts.speak("Hello world", 0, null);
        }
      };
}

When I start this application, than a message comes up: "This application can talk using the text-to-speech (TTS) libary. Please install the TTS."I clicked on "install the TTS" And the Exception "Sorry! The application Hello you! (process wolf.android.hello) has stopped unexpectedly. Please try again." came up.

Can someone help me with this? I am trying to fix this since monday and its still not working.

MFG Da Wolf
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones