专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Android

android text to speech中文如何做

发布时间:2010-05-30 10:54:42 文章来源:www.iduyao.cn 采编人员:星星草
android text to speech中文怎么做?
android 1.6有新增tts的接口, 但是只有5种语言,其中没有中文, 但是看到一些别的程序里面可以有中文语音. 好像是用到了
tts service(google.tts.ophone8.apk)这个服务. 这个应该怎么调用? 在哪能找到相关资料? 


------解决方案--------------------
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);
}
};
}
------解决方案--------------------
http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/tutorial.html
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: