# Text to Speech Java Starter Application
The IBM Watson [Text to Speech][service_url] service is designed for streaming, low latency, synthesis of audio from text. It is the inverse of the automatic speech recognition. The TTS service can be accessed via a REST interface or directly via TCP.
Give it a try! Click the button below to fork into IBM DevOps Services and deploy your own copy of this application on Bluemix.
[![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy)
## Getting Started
1. Create a Bluemix Account
[Sign up][sign_up] in Bluemix, or use an existing account. Watson Services in Beta are free to use.
2. Download and install the [Cloud-foundry CLI][cloud_foundry] tool
3. Edit the `manifest.yml` file and change the `<application-name>` to something unique.
```none
applications:
- services:
- text-to-speech-service
name: <application-name>
path: webApp.war
memory: 512M
```
The name you use determines your initial application URL, e.g.,
`<application-name>.mybluemix.net`.
4. Connect to Bluemix in the command line tool.
```sh
$ cf api https://api.ng.bluemix.net
$ cf login -u <your-user-ID>
```
5. Create the Text to Speech service in Bluemix.
```sh
$ cf create-service text_to_speech standard text-to-speech-service
```
6. Download and install the [ant][ant] compiler.
7. Build the project.
You need to use the Apache `ant` compiler to build the Java application.
For information about the `ant` compiler and to download a copy for your
operating system, visit ant.apache.org.
```sh
$ ant
```
8. Push it live!
```sh
$ cf push -p outut/webApp.war
```
## Running locally
The application uses the WebSphere Liberty profile runtime as its server,
so you need to download and install the profile as part of the steps below.
1. Copy the credentials from your `text-to-speech-service-standard` service in Bluemix to
`DemoServlet.java`. You can use the following command to see the
credentials:
```sh
$ cf env <application-name>
```
Example output:
```sh
System-Provided:
{
"VCAP_SERVICES": {
"text_to_speech": [{
"credentials": {
"url": "<url>",
"password": "<password>",
"username": "<username>"
},
"label": "text_to_speech",
"name": "text-to-speech-service",
"plan": "standard"
}]
}
}
```
You need to copy the `username`, `password`, and `url`.
2. Install the [Liberty profile runtime][liberty] (for Mac OSX, check this
[guide][liberty_mac]).
3. Create a Liberty profile server in Eclipse.
4. Add the application to the server.
5. Start the server.
6. Go to `http://localhost:9080/app/` to see the running application.
## Troubleshooting
To troubleshoot your Bluemix application, the most useful source of
information is the log files. To see them, run the following command:
```sh
$ cf logs <application-name> --recent
```
## License
This sample code is licensed under Apache 2.0. Full license text is available in [LICENSE](LICENSE).
The sample uses jQuery which is licensed under MIT
## Contributing
See [CONTRIBUTING](CONTRIBUTING.md).
## Open Source @ IBM
Find more open source projects on the
[IBM Github Page](http://ibm.github.io/).
[service_url]: http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/text-to-speech.html
[cloud_foundry]: https://github.com/cloudfoundry/cli
[sign_up]: https://apps.admin.ibmcloud.com/manage/trial/bluemix.html?cm_mmc=WatsonDeveloperCloud-_-LandingSiteGetStarted-_-x-_-CreateAnAccountOnBluemixCLI
[liberty]: https://developer.ibm.com/wasdev/downloads/
[liberty_mac]: http://www.stormacq.com/how-to-install-websphere-8-5-liberty-profile-on-mac/
[ant]: http://ant.apache.org/bindownload.cgi
没有合适的资源?快使用搜索试试~ 我知道了~
Bluemix文本转语音实例
共43个文件
jar:11个
js:4个
prefs:3个
4星 · 超过85%的资源 需积分: 6 57 下载量 20 浏览量
2016-02-05
10:29:16
上传
评论 1
收藏 94.95MB 7Z 举报
温馨提示
Bluemix文本转语音实例。具体效果和过程可以看博文http://blog.csdn.net/evankaka/article/details/50635575
资源推荐
资源详情
资源评论
收起资源包目录
text-to-speech-java-master.7z (43个子文件)
text-to-speech-java-master
NOTICE 95B
manifest.yml 206B
build.xml 2KB
WebContent
css
watson-bootstrap-dark.css 124KB
style.css 2KB
images
app.png 5KB
fork-icon.svg 1KB
favicon.ico 3KB
META-INF
MANIFEST.MF 36B
WEB-INF
web.xml 806B
classes
com
ibm
cloudoe
samples
DemoServlet.class 6KB
lib
standard-1.1.2.jar 384KB
httpcore-4.3.2.jar 276KB
ogclient.jar 23.91MB
fluent-hc-4.3.4.jar 29KB
commons-logging-1.1.3.jar 61KB
commons-codec-1.6.jar 227KB
jstl-1.2.jar 405KB
json-org.jar 36KB
httpclient-4.3.4.jar 576KB
js
jquery-1.11.1.min.js 94KB
demo.js 2KB
browser-detect.js 2KB
constants.js 3KB
index.jsp 5KB
output
manifest.yml 206B
webApp.war 71.39MB
LICENSE 11KB
.settings
org.eclipse.ltk.core.refactoring.prefs 104B
org.eclipse.wst.common.project.facet.core.xml 252B
org.eclipse.wst.common.component 490B
org.eclipse.wst.ws.service.policy.prefs 189B
org.eclipse.jdt.core.prefs 658B
CONTRIBUTING.md 755B
src
com
ibm
cloudoe
samples
DemoServlet.java 4KB
.project 1016B
.classpath 740B
.gitignore 75B
lib
README.txt 89B
com.ibm.ws.javaee.servlet.3.0_1.0.2.jar 91KB
com.ibm.websphere.appserver.api.json_1.0.2.jar 14KB
README.md 4KB
build
bin
com
ibm
cloudoe
samples
DemoServlet.class 6KB
共 43 条
- 1
资源评论
- JaydonSun2017-11-12我这边不能用,不知道是为什么
- u0106200822016-07-18不错可以用
Evankaka
- 粉丝: 7702
- 资源: 129
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功