- 浏览: 302110 次
- 性别:
- 来自: 南京
文章分类
最新评论
-
ggwang:
谢谢分享!
如何释放Ubuntu多余的空间?如何给Ubuntu扩容(install inside windows)? -
allenshao:
只有放枪咯~~~~~
Google Group Android Developers 无法打开的问题 -
malong26:
也打不开~~~
Google Group Android Developers 无法打开的问题 -
songshuang:
一直喂它会一直吃是不?
用你的鼠标逗逗它 -
allenshao:
现在基本上用免费的VPN,缺点是限流量。
如何访问appspot网站?
1 Introduction
The Text-To-Speech (TTS) library is allows developers to add speech to their applications. Developers give the TTS object a text string, and the TTS will take care of converting that string to text and speaking it to the user.
The TTS library is designed such that different underlying speech engines can be used without affecting the higher level application logic. Currently, a port of the eSpeak engine is available.
2 Requirements
Using the eSpeak engine requires the user to have an SD card with free space available that the phone can access. The voice data for eSpeak will be downloaded and unzipped onto the SD card when the TTS is first run.
Note that if the SD card is mounted on the computer, it will not be accessible to the phone. You must unmount the SD card from the computer before the TTS will work properly.
3 Setting Up an Eclipse Project That Uses the TTS
Setup an Android project as you would normally.
Go to Project > Properties > Java Build Path > Libraries and click on "Add External JARs..." Then add in the TTS_library_stub.jar file.
Start coding!
4 A Step-By-Step Tutorial To Get You Started
This tutorial will take you step-by-step through writing a simple Hello World application. It assumes that you have Eclipse setup to work with the Android SDK already.
Get the TTS_library_stub.jar file from the downloads area. If you want to develop against the upcoming release, get the release candidate version by grabbing the _rc.jar and installing the _rc.apk on your phone. If you want to develop against the version of the TTS that is currently on Market, get the _market.jar and install the TTS from the Android Market. You should always build your app using the _market version before you release it on the Market; otherwise, there is a high probability that your app will not work correctly as most users will be on the Market version of the TTS and not the release candidate.
Start Eclipse. Go to "File" > "New Project" > "Project..." and choose "Android Project" under "Android". Fill out the information and click "Finish" to generate the skeleton for a project. The rest of this tutorial assumes that you named your application "HelloWorldTTS".
Select your project in the "Package Explorer", then go to "Project" > "Properties". Select "Java Build Path" and click on the "Libraries" tab. Click on "Add external JARs..." and select the TTS_library_stub.jar from step 1.
You should see two Java files in your project: HelloWorldTTS.java and R.java. Open HelloWorldTTS.java and do the following: -In the imports section at the top of the file, add this line:
import com.google.tts.TTS;
-After the line "public class HelloWorldTTS extends Activity {", add this line:
private TTS myTts;
-Add the following as the last line of the onCreate method:
myTts = new TTS(this, ttsInitListener, true);
-After the onCreate method, add these lines:
Now you should have a HelloWorldTTS.java that looks something like this.
Build this app, install it on your Android device, and run it. You should hear the TTS say "hello world" if you have the TTS library installed on the phone and your SD card contains the needed voice data files.
If you do not have the TTS library installed on the phone, you will be prompted to install it.
If this is the first time you have used an app that uses the TTS, you will hear the TTS spell out "h e l l o w o r l d" very fast and see a screen that says your device is downloading the voice data files; if you rerun the app, you will hear the TTS say "hello world" as it should.
Congratulations! You just wrote your first TTS-enabled Android app! Please see the documentation on the TTS and look at other apps in the eyes-free project to learn more about how to use the TTS.
Notes:
The TTS constructor takes 3 parameters: the application Context, the TTS.InitListener to call upon successful initialization of the TTS, and whether or not to show a message prompting the user to install the TTS from the Market if they have not done so already.
The speak call takes 3 parameters: the String of text to be spoken, an int that indicates the queuing strategy (0 for no queuing, 1 for fifo queuing), and an array of Strings that are parameters for how to speak the text.
The first time you run an app that uses the TTS, if you do not already have the necessary voice data files on your SD card, they will be downloaded automatically.
5 Tips and Tricks on Using the TTS in Your App
For some tips and tricks on using the TTS in your app, please see the usage notes here.http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/usage_notes.html
转自http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/tutorial.html
The Text-To-Speech (TTS) library is allows developers to add speech to their applications. Developers give the TTS object a text string, and the TTS will take care of converting that string to text and speaking it to the user.
The TTS library is designed such that different underlying speech engines can be used without affecting the higher level application logic. Currently, a port of the eSpeak engine is available.
2 Requirements
Using the eSpeak engine requires the user to have an SD card with free space available that the phone can access. The voice data for eSpeak will be downloaded and unzipped onto the SD card when the TTS is first run.
Note that if the SD card is mounted on the computer, it will not be accessible to the phone. You must unmount the SD card from the computer before the TTS will work properly.
3 Setting Up an Eclipse Project That Uses the TTS
Setup an Android project as you would normally.
Go to Project > Properties > Java Build Path > Libraries and click on "Add External JARs..." Then add in the TTS_library_stub.jar file.
Start coding!
4 A Step-By-Step Tutorial To Get You Started
This tutorial will take you step-by-step through writing a simple Hello World application. It assumes that you have Eclipse setup to work with the Android SDK already.
Get the TTS_library_stub.jar file from the downloads area. If you want to develop against the upcoming release, get the release candidate version by grabbing the _rc.jar and installing the _rc.apk on your phone. If you want to develop against the version of the TTS that is currently on Market, get the _market.jar and install the TTS from the Android Market. You should always build your app using the _market version before you release it on the Market; otherwise, there is a high probability that your app will not work correctly as most users will be on the Market version of the TTS and not the release candidate.
Start Eclipse. Go to "File" > "New Project" > "Project..." and choose "Android Project" under "Android". Fill out the information and click "Finish" to generate the skeleton for a project. The rest of this tutorial assumes that you named your application "HelloWorldTTS".
Select your project in the "Package Explorer", then go to "Project" > "Properties". Select "Java Build Path" and click on the "Libraries" tab. Click on "Add external JARs..." and select the TTS_library_stub.jar from step 1.
You should see two Java files in your project: HelloWorldTTS.java and R.java. Open HelloWorldTTS.java and do the following: -In the imports section at the top of the file, add this line:
import com.google.tts.TTS;
-After the line "public class HelloWorldTTS extends Activity {", add this line:
private TTS myTts;
-Add the following as the last line of the onCreate method:
myTts = new TTS(this, ttsInitListener, true);
-After the onCreate method, add these lines:
private TTS.InitListener ttsInitListener = new TTS.InitListener() { public void onInit(int version) { myTts.speak("Hello world", 0, null); } };
Now you should have a HelloWorldTTS.java that looks something like this.
Build this app, install it on your Android device, and run it. You should hear the TTS say "hello world" if you have the TTS library installed on the phone and your SD card contains the needed voice data files.
If you do not have the TTS library installed on the phone, you will be prompted to install it.
If this is the first time you have used an app that uses the TTS, you will hear the TTS spell out "h e l l o w o r l d" very fast and see a screen that says your device is downloading the voice data files; if you rerun the app, you will hear the TTS say "hello world" as it should.
Congratulations! You just wrote your first TTS-enabled Android app! Please see the documentation on the TTS and look at other apps in the eyes-free project to learn more about how to use the TTS.
Notes:
The TTS constructor takes 3 parameters: the application Context, the TTS.InitListener to call upon successful initialization of the TTS, and whether or not to show a message prompting the user to install the TTS from the Market if they have not done so already.
The speak call takes 3 parameters: the String of text to be spoken, an int that indicates the queuing strategy (0 for no queuing, 1 for fifo queuing), and an array of Strings that are parameters for how to speak the text.
The first time you run an app that uses the TTS, if you do not already have the necessary voice data files on your SD card, they will be downloaded automatically.
5 Tips and Tricks on Using the TTS in Your App
For some tips and tricks on using the TTS in your app, please see the usage notes here.http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/usage_notes.html
转自http://eyes-free.googlecode.com/svn/trunk/documentation/tutorial/tutorial.html
发表评论
-
AOSP source code build error: Virtual memory exhausted: Cannot allocate memory
2014-01-02 15:47 1383Sometimes compiling certain thi ... -
What is the purpose of different Android partitions
2014-01-02 09:57 744-- Boot partition stores the An ... -
Android Kitkat ART vs. Dalvik & Impacts for end-users
2013-12-08 19:00 834What's ART? ART is Google's 2- ... -
error: gnutls_handshake() falied when you sync chip code in ubuntu
2013-11-30 19:47 927gnutls package is broken, worka ... -
unix2dos dos2unix
2013-03-04 20:12 798sudo aptitude install tofrodos ... -
How to make resources added in frameworks/base/core/res/res
2013-02-23 10:19 10881) add the new id to your xml 2 ... -
JDK6 installed in Ubuntu
2012-11-10 15:23 856按照网上的方法apt-get并不成功,我这里采用的方法是手工安 ... -
Android source sync问题汇总(since 2012)
2012-11-04 16:00 18381. [repo init] fetch address is ... -
Android Partitions Explained: boot, system, recovery, data, cache & misc
2012-09-06 16:17 1108Unless you have been using your ... -
Android IPC AudioFlinger binder实例
2012-06-20 13:32 1020一篇 android 的 IPC 机制 binder ... -
Eclipse Android project name有错误, source tree无红叉解决办法
2012-06-07 13:22 1318linux: Window -> Preference ... -
Android内核开发的几个常用命令
2012-02-23 15:29 1020在android源码的根目录下执行: . build/env ... -
MTP (Media Transfer Protocol) Introduction
2012-02-07 14:46 2321微軟制訂了一套名 ... -
Why is Android laggy, while iOS, Windows Phone 7, QNX, and WebOS are fluid?
2011-12-12 17:55 1042The Root Cause It’s not GC p ... -
Writing Native Code for Android Systems
2011-09-26 17:53 808Writing Native Code for Android ... -
Android JNI 使用的数据结构JNINativeMethod详解
2011-09-13 10:26 896Andoird 中使用了一种不同传统Java JNI的方 ... -
Android property system
2011-08-25 15:11 1342属性系统是 android 的一个重 ... -
Android boot process stub
2011-07-20 10:08 0Android's boot up process is su ... -
Android boot process stub
2011-07-20 10:07 964Android's boot up process is su ... -
OpenFrameworks + kinect + Android
2011-06-20 15:29 1448How to make: 1.Setup ofxAndr ...
相关推荐
Android TTS(Text-to-Speech)是Android操作系统中的一项服务,允许应用程序将文本转换成语音输出,用户无需手动输入即可听取设备读出的文字内容。这个技术对于视力障碍者、学习新语言的人或者在驾驶等不便看屏幕的...
本实例将详细介绍如何在Android应用中实现一个简单的TTS文字转语音的功能。 首先,我们需要在AndroidManifest.xml文件中添加必要的权限,用于访问TTS服务: ```xml <uses-permission android:name="android....
Android TTS(Text-to-Speech)系统是Android操作系统中的一个重要组成部分,它允许应用程序将文本转换为可听见的语音输出,从而实现文字的语音合成。在Android应用开发中,TTS功能广泛应用于各种场景,如阅读电子书...
总的来说,这个“android TTS语音引擎包”为Android开发者提供了丰富的选择,以适应各种应用场景,无论是教育应用、导航应用还是阅读应用,都可以利用这些引擎实现自然、流畅的语音输出。通过合理选择和集成,开发者...
本项目"Android-一个基于Java的粤语发音TTS文字转语音"显然旨在提供这样的功能,它可能包含了一个自定义的TTS引擎或者接口,以便在Android应用中集成粤语的语音合成。 在Android开发中,TTS服务是通过Android SDK...
Android的文本转语音(Text-to-Speech,简称TTS)技术是一种将文本数据转换为可听见的语音输出的系统,广泛应用于各种应用中,如阅读器、导航、语音助手等。在Android Studio环境下,开发者可以方便地利用Android...
Android TTS(Text-to-Speech)是Android系统提供的一个服务,允许应用程序将文本转换为语音输出。这个功能在很多场景下都非常有用,比如辅助阅读、导航提示或者为视力障碍者提供帮助。在Android平台上实现中文转...
Android TTS(Text-to-Speech)是Android系统提供的一个核心功能,它允许应用程序将文本转换为语音输出。这个功能在很多场景下非常有用,比如帮助视力障碍用户阅读屏幕上的文字,或者在驾驶时提供导航指引。本文将...
Android TTS(Text-to-Speech)是Android系统中用于将文本转换为语音输出的功能,它允许应用程序以语音的形式朗读出屏幕上的文字。这个“Android_tts项目源码 demo”显然是一个示例项目,用于展示如何在Android应用...
在Android平台上,文本转语音(Text-to-Speech, 简称TTS)技术是一种将文字信息转化为可听见的语音输出的重要功能。Android TTS实现简单阅读器是开发者利用此技术构建的一个应用示例,旨在帮助用户理解如何在Android...
总之,Android TTS jar和TTS_library_stub_3.0_market jar是针对Android系统TTS功能的增强解决方案,它们解决了原生TTS在中文支持上的不足,提供了更稳定、兼容性更强的文本转语音服务。开发者可以利用这些资源创建...
在Android开发中,Text-to-Speech (TTS) 技术是将文本转换为语音输出的重要功能,尤其适用于辅助视力障碍者或者在驾驶等不便查看屏幕的场景。本主题聚焦于如何在Android Studio中实现离线中文语音播放,支持男声和...
在Android平台上,TTS系统是为开发者提供的一种服务,它允许应用程序将文字转换成自然语言的语音,使得用户无需查看屏幕也能获取信息,这对于视觉障碍者或者在驾驶、做家务等不便看屏幕的场景下尤其有用。...
标题中的“tts.rar_TTS java_android TTS_google GetSampleText_tts android_中”表明这是一个关于Android平台上的文本转语音(Text-to-Speech,简称TTS)技术的压缩包,涉及Java编程语言,可能包含了Google的TTS...
科大讯飞作为国内领先的语音技术提供商,其在Android平台上的离线TTS解决方案——"TTS.zip_android_surface5nn",为开发者提供了高效、高质量的文本转语音服务,无需依赖网络连接即可实现流畅的语音合成。...
某些场景下,部分安卓设备并没有自带安装Google TTS服务,若是从商店下载应用后,需要翻墙下载语言包,为了跨过这个翻墙的闹心事,通过两天的收集,现将已收集到的中文语言包分享给大家,其中也有其他语种的,可自行...
Android TTS(Text-to-Speech)是Android系统提供的一个服务,允许应用程序将文本转换为语音输出,从而实现让设备“朗读”文本的功能。在Android应用开发中,TTS技术常用于帮助视障用户或者在驾驶、烹饪等不便查看...
在Android平台上,Text-to-Speech(TTS)技术是一种将文本转换为语音输出的功能,它使得应用程序能够“读出”屏幕上的文字,这对于视力障碍的用户或者在不方便阅读时非常有用。本项目“基于Android的TTs”显然是一个...
在Android平台上,实现“文字转语音”(Text-to-Speech, TTS)功能是一项常见的需求,尤其对于有读屏需求的用户或者希望增加互动性的应用来说。本篇将详细讲解如何在Android应用中实现文字转语音功能,特别关注对...
综上所述,这个项目展示了如何在Delphi XE5环境中利用Android的TTS服务,为Android应用程序添加文本转语音的功能。通过阅读和分析`Unit1.pas`和`Unit1.fmx`,我们可以深入了解具体的实现细节,如事件处理、TTS引擎的...