android 1.6有新增tts的接口, 但是只有5种语言,其中没有中文, 但是看到一些别的程序里面可以有中文语音. 好像是用到了
tts service(google.tts.ophone8.apk)这个服务. 这个应该怎么调用? 在哪能找到相关资料? 

解决方案 »

  1.   

    import com.google.tts.TTS;import android.app.Activity;
    import android.os.Bundle;public class HelloWorldTTS 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);
            }
          };
    }
      

  2.   

    http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/tutorial.html
      

  3.   


    你好,那个eyes-free我也有看了,但是下载它的tts_3.0_rc03.apk程序在adt上装不了,不知道怎么回事.用它的TTS_library_stub_3.0_rc00.jar 这个包就可以直接使用中文了么?
      

  4.   

    如果直接用3楼网页的内容,程序运行后他会提示安装text-to-speech library 这个是什么东西? 是那个tts_3.0_rc03.apk还是tts service(google.tts.ophone8.apk),前者我装不上,后者装了不好使.
      

  5.   

    eclipse 上模拟器好像能用TTS 但是手机上好像都屏蔽掉了  这个怎么解决