Skip to content

Commit 8e1f5d9

Browse files
chore: Update README
1 parent 825c9af commit 8e1f5d9

3 files changed

Lines changed: 72 additions & 108 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ deploy:
2222
- bx-blue-green-travis
2323
on:
2424
branch: master
25-
repo: watson-developer-cloud/assistant-simple
25+
repo: watson-developer-cloud/speech-to-text-nodejs
2626
- provider: script
2727
skip_cleanup: true
2828
script: npx semantic-release

README.md

Lines changed: 70 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,111 @@
1-
# Speech to Text Browser Application
1+
<h1 align="center" style="border-bottom: none;">🎤 Speech to Text Demo </h1>
2+
<h3 align="center">Node.js sample applications that shows some of the the IBM Watson Speech to Text service features.</h3>
3+
<p align="center">
4+
<a href="http://travis-ci.org/watson-developer-cloud/speech-to-text-nodejs">
5+
<img alt="Travis" src="https://travis-ci.org/watson-developer-cloud/speech-to-text-nodejs.svg?branch=master">
6+
</a>
7+
<a href="#badge">
8+
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
9+
</a>
10+
</p>
11+
</p>
212

3-
[![Build Status](https://travis-ci.org/watson-developer-cloud/speech-to-text-nodejs.svg?branch=master)](https://travis-ci.org/watson-developer-cloud/speech-to-text-nodejs)
13+
The [Speech to Text][service_url] service uses IBM's speech recognition capabilities to convert speech in multiple languages into text. The transcription of incoming audio is continuously sent back to the client with minimal delay, and it is corrected as more speech is heard. The service is accessed via a WebSocket interface; a REST HTTP interface is also available;
414

5-
The [Speech to Text][service_url] service uses IBM's speech recognition capabilities to convert speech in multiple languages into text. The transcription of incoming audio is continuously sent back to the client with minimal delay, and it is corrected as more speech is heard. The service is accessed via a WebSocket interface; a REST HTTP interface is also available;
15+
You can view a [demo][demo_url] of this app.
616

7-
Node.js is also used to provide the browser client's authentication token.
17+
## Prerequisites
818

9-
[![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy?repository=https://github.com/watson-developer-cloud/speech-to-text-nodejs)
19+
1. Sign up for an [IBM Cloud account](https://console.bluemix.net/registration/).
20+
1. Download the [IBM Cloud CLI](https://console.bluemix.net/docs/cli/index.html#overview).
21+
1. Create an instance of the Speech to Text service and get your credentials:
22+
- Go to the [Speech to Text](https://console.bluemix.net/catalog/services/speech-to-text) page in the IBM Cloud Catalog.
23+
- Log in to your IBM Cloud account.
24+
- Click **Create**.
25+
- Click **Show** to view the service credentials.
26+
- Copy the `apikey` value, or copy the `username` and `password` values if your service instance doesn't provide an `apikey`.
27+
- Copy the `url` value.
1028

11-
## Getting started
29+
## Configuring the application
1230

13-
1. You need a Bluemix account. If you don't have one, [sign up][sign_up].
31+
1. In the application folder, copy the *.env.example* file and create a file called *.env*
1432

15-
2. Download and install the [Cloud-foundry CLI][cloud_foundry] tool if you haven't already.
33+
```
34+
cp .env.example .env
35+
```
1636
17-
3. Edit the `manifest.yml` file and change `<application-name>` to something unique. The name you use determines the URL of your application. For example, `<application-name>.mybluemix.net`.
37+
2. Open the *.env* file and add the service credentials that you obtained in the previous step.
1838
19-
```yaml
20-
applications:
21-
- services:
22-
- my-service-instance
23-
name: <application-name>
24-
command: npm start
25-
path: .
26-
memory: 512M
27-
```
39+
Example *.env* file that configures the `apikey` and `url` for a Speech to Text service instance hosted in the US East region:
2840
29-
4. Connect to Bluemix with the command line tool.
41+
```
42+
SPEECH_TO_TEXT_IAM_APIKEY=X4rbi8vwZmKpXfowaS3GAsA7vdy17Qh7km5D6EzKLHL2
43+
SPEECH_TO_TEXT_URL=https://stream-wdc.watsonplatform.net/speech-to-text/api
44+
```
3045
31-
```sh
32-
cf api https://api.ng.bluemix.net
33-
cf login
34-
```
46+
- If your service instance uses `username` and `password` credentials, add the `SPEECH_TO_TEXT_USERNAME` and `SPEECH_TO_TEXT_PASSWORD` variables to the *.env* file.
3547
36-
5. Create and retrieve service keys to access the [Speech to Text][service_url] service:
48+
Example *.env* file that configures the `username`, `password`, and `url` for a Speech to Text service instance hosted in the Sydney region:
3749
38-
```none
39-
cf create-service speech_to_text standard my-stt-service
40-
cf create-service-key my-stt-service myKey
41-
cf service-key my-stt-service myKey
42-
```
50+
```
51+
SPEECH_TO_TEXT_USERNAME=522be-7b41-ab44-dec3-g1eab2ha73c6
52+
SPEECH_TO_TEXT_PASSWORD=A4Z5BdGENrwu8
53+
SPEECH_TO_TEXT_URL=https://gateway-syd.watsonplatform.net/speech-to-text/api
54+
```
4355
44-
6. Create a `.env` file in the root directory by copying the sample `.env.example` file using the following command:
56+
## Running locally
4557
46-
```none
47-
cp .env.example .env
48-
```
49-
You will update the `.env` with the information you retrieved in steps 5.
58+
1. Install the dependencies
5059
51-
The `.env` file will look something like the following:
60+
```
61+
npm install
62+
```
5263
53-
```none
54-
SPEECH_TO_TEXT_USERNAME=<username>
55-
SPEECH_TO_TEXT_PASSWORD=<password>
56-
```
64+
1. Run the application
5765
58-
7. Install the dependencies you application need:
66+
```
67+
npm start
68+
```
5969
60-
```none
61-
npm install
62-
```
70+
1. View the application in a browser at `localhost:3000`
6371
64-
8. Start the application locally:
72+
## Deploying to IBM Cloud as a Cloud Foundry Application
6573
66-
```none
67-
npm start
68-
```
74+
1. Login to IBM Cloud with the [IBM Cloud CLI](https://console.bluemix.net/docs/cli/index.html#overview)
6975
70-
9. Point your browser to [http://localhost:3000](http://localhost:3000).
76+
```
77+
ibmcloud login
78+
```
7179
72-
10. **Optional:** Push the application to Bluemix:
80+
1. Target a Cloud Foundry organization and space.
7381
74-
```none
75-
cf push
76-
```
82+
```
83+
ibmcloud target --cf
84+
```
7785
78-
After completing the steps above, you are ready to test your application. Start a browser and enter the URL of your application.
86+
1. Edit the *manifest.yml* file. Change the **name** field to something unique. For example, `- name: my-app-name`.
87+
1. Deploy the application
7988
80-
<your application name>.mybluemix.net
89+
```
90+
ibmcloud app push
91+
```
8192
93+
1. View the application online at the app URL, for example: https://my-app-name.mybluemix.net
8294
83-
For more details about developing applications that use Watson Developer Cloud services in Bluemix, see [Getting started with Watson Developer Cloud and Bluemix][getting_started].
84-
85-
86-
## Troubleshooting
87-
88-
* The main source of troubleshooting and recovery information is the Bluemix log. To view the log, run the following command:
89-
90-
```sh
91-
cf logs <application-name> --recent
92-
```
93-
94-
* For more details about the service, see the [documentation][docs] for the Speech to Text service.
95-
96-
97-
----
98-
99-
### Directory structure
100-
101-
```none
102-
.
103-
├── app.js // express routes
104-
├── config // express configuration
105-
│ ├── express.js
106-
│ └── security.js
107-
├── manifest.yml
108-
├── package.json
109-
├── public // static resources
110-
├── server.js // entry point
111-
├── test // tests
112-
└── views // react components
113-
```
11495
11596
## License
11697
11798
This sample code is licensed under Apache 2.0.
11899
119100
## Contributing
120101
121-
See [CONTRIBUTING](CONTRIBUTING.md).
102+
See [CONTRIBUTING](./CONTRIBUTING.md).
122103
123104
## Open Source @ IBM
124105
Find more open source projects on the [IBM Github Page](http://ibm.github.io/)
125106
126-
## Privacy Notice
127-
128-
Sample web applications that include this package may be configured to track deployments to [IBM Bluemix](https://www.bluemix.net/) and other Cloud Foundry platforms. The following information is sent to a [Deployment Tracker](https://github.com/IBM-Bluemix/cf-deployment-tracker-service) service on each deployment:
129-
130-
* Node.js package version
131-
* Node.js repository URL
132-
* Application Name (`application_name`)
133-
* Space ID (`space_id`)
134-
* Application Version (`application_version`)
135-
* Application URIs (`application_uris`)
136-
* Labels of bound services
137-
* Number of instances for each bound service and associated plan information
138-
139-
This data is collected from the `package.json` file in the sample application and the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
140107
141-
[deploy_track_url]: https://github.com/cloudant-labs/deployment-tracker
142-
[cloud_foundry]: https://github.com/cloudfoundry/cli
143-
[getting_started]: https://www.ibm.com/watson/developercloud/doc/common/index.html
144108
[service_url]: https://www.ibm.com/watson/services/speech-to-text/
145-
[docs]: http://www.ibm.com/watson/developercloud/speech-to-text/
146-
[sign_up]: https://console.bluemix.net/registration/
109+
[docs]: https://www.ibm.com/watson/developercloud/speech-to-text/api/v1/curl.html?curl
110+
[sign_up]: https://console.bluemix.net/registration/?target=/catalog/services/speech-to-text/
111+
[demo_url]: https://speech-to-text-demo.ng.bluemix.net

app.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ let tokenManager;
3131
if (process.env.SPEECH_TO_TEXT_IAM_APIKEY && process.env.SPEECH_TO_TEXT_IAM_APIKEY !== '') {
3232
tokenManager = new IamTokenManagerV1({
3333
iamApikey: process.env.SPEECH_TO_TEXT_IAM_APIKEY || '<iam_apikey>',
34-
iam_url: process.env.SPEECH_TO_TEXT_IAM_URL || 'https://iam.bluemix.net/identity/token',
35-
url: process.env.SPEECH_TO_TEXT_URL || '<url>',
34+
iamUrl: process.env.SPEECH_TO_TEXT_IAM_URL || 'https://iam.bluemix.net/identity/token',
3635
});
3736
} else {
3837
const speechService = new SpeechToTextV1({

0 commit comments

Comments
 (0)