Android TTS 中文 文字转语音 使用TextToSpeech Svox
来源:互联网 发布:英国 欧洲大陆 知乎 编辑:程序博客网 时间:2024/05/16 07:11
Android默认没有安装TTS数据包,无法文字转语音,而在设置里推荐的语音包是Pico TTS,并不支持中文,如果需要读中文,需要下载另外的第三方语音包,如:eSpeak,Svox,个人建议Svox,eSpeak非常生硬,而且很多汉字都读不出,不支持中英文混读(英文当拼音读)。下载链接自己Google下吧,很多软件市场都有下载。下载安装后打开设置-语音输入和输出-文字转语音设置,勾选Svox Classic TTS,语言选择中文或广东话(Svox安装后还要下载安装相应的语言包的,类似插件)。接下来代码就简单了,关键的就两三行:
package com.pocketdigi; import android.app.Activity;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button; public class TTSActivity extends Activity { /** Called when the activity is first created. */TextToSpeech tts;Button btn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btn=(Button)findViewById(R.id.btn); tts = new TextToSpeech(this, null); //实例化 btn.setOnClickListener(new OnClickListener(){ @Overridepublic void onClick(View v) {// TODO Auto-generated method stubtts.speak("测试一下", TextToSpeech.QUEUE_FLUSH, null);//语音输出}}); }}
12345678910111213141516171819202122232425262728293031
用Svox,效果还不错。
2011年7月21日加注:
貌似使用Svox后,isLanguageAvailable就不能检测语言是否支持了,而Pico TTS是可以的
Svox Classic TTS(Svox中文语音插件)v2.0.4 告别英文语音
public class TTSActivity extends Activity { /** Called when the activity is first created. */TextToSpeech tts;Button btn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btn=(Button)findViewById(R.id.btn); tts = new TextToSpeech(this, null); //实例化 btn.setOnClickListener(new OnClickListener(){ @Overridepublic void onClick(View v) {// TODO Auto-generated method stubtts.speak("测试一下", TextToSpeech.QUEUE_FLUSH, null);//语音输出}}); }}Svox Classic TTS
软件大小:2.22M
软件版本:2.0.4
开发作者:SVOX Mobile Voices
适用固件:2.1,2.2,2.3.1,2.3.3,
适用分辨率:240x320 240x400 240x432 320x480 360x640 480x800 480x848 480x854 600x1024 600x800 720x1280
Svox Classic TTS(Svox语音插件) v2.0.4;
一款好用的语音插件,支持多种语言阅读。第三方语音识别软件可用,例如:超级短信Handcent Sms等。需下载语音包才可使用,现提供已付费中文普通话语音包和粤语语音包。
软件下载:
http://u.115.com/file/f5b8d8f669#
com.svox.classic.apk
语音包下载地址:
中文普通话语音包:http://www.nduoa.com/web/soft/show/id/4954
粤语语音包:http://www.nduoa.com/web/soft/show/id/4955
使用教程:
Svox Classic TTS(Svox中文语音插件)详细安装方法,绝对可用
- Android TTS 中文 文字转语音 使用TextToSpeech Svox
- Android TTS 中文 文字转语音 使用TextToSpeech Svox
- Android TTS 中文 文字转语音 使用TextToSpeech Svox .
- 使用Svox实现中文转语音TextToSpeech(TTS)
- 使用Svox实现中文转语音TextToSpeech(TTS)
- Android中使用TTS(TextToSpeech)将文字转为语音
- Android TTS 英文或中文(要下载中文支持包)转语音 使用TextToSpeech
- Android 文本转语音TextToSpeech (TTS)
- Android TTS文本转语音TextToSpeech
- Android TTS(TextToSpeech)语音输出与RecognizerIntent语音识别
- 安卓文字转语音实例+代码+TextToSpeech的使用
- Android TTS文字转语音开发
- 关于Android文字转语音(TTS)开发
- Android文字转语音TTS离线程序
- Android TTS 文字转语音开发
- Android TTS学习--使用中文语音
- TTS(TextToSpeech)将文本转为语音的简单使用
- 文字合成语音TextToSpeech语音解决中文不能用问题
- 根视图之UIView的一些基本方法
- 七种操作系统的发展史及特点
- android ScrollView嵌套ListView
- svn commit 时 Could not use external editor to fetch log message
- 获取 select option text
- Android TTS 中文 文字转语音 使用TextToSpeech Svox
- The VMware Authorization Service is not running
- 应用层通过CreateFile函数调用驱动产生代号为123的错误修正方法
- NSDictionary / NSMutableDictionary 及 NSArray / NSmutableArray (实例)
- test
- 解决TCP网络传输“粘包”问题
- PowerPC 体系结构之存储管理
- 利用模板导出数据到Excel中
- asp.net从客户端中检测到有潜在危险的Request.Form值