Skip to content

Commit f8494b4

Browse files
committed
cleaning up readme, linking to correct version docs in published readme
1 parent 1818433 commit f8494b4

File tree

2 files changed

+22
-62
lines changed

2 files changed

+22
-62
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ before_install:
77
- sh -e /etc/init.d/xvfb start
88
script:
99
- npm test
10+
- sed -i "s/\/master\//\/$TRAVIS_BRANCH\//g" README.md # replace "master" in doc urls with current branch/tag
1011
- npm run doc
1112
after_success:
1213
- jsdoc/publish.sh
@@ -30,6 +31,7 @@ deploy:
3031
3132
api_key:
3233
secure: SPayKFCZfsEznCkOuH/tX9R1ZmtZZ98JkPOv6AiVatGrFIsAx0WWQWyebx1X9dvtxznTwslP0u/nv+i5ErtMdjutyhylz/rwJ7v1s0vR8+4E8JpnPOIOHX1YWybCz38N6u7Ue6+Km4AxmtnTeEhfChn3R4qgJK3qlit8GRxpOlBzUWDFbUYHz6TZOn3YnU2i1bruxcWLwfwXs0Pef1tIZrNC3LrvqpU39REX+vAFMSCTN+1F7u/Aax+zSp2POJkbpV9ijVXtQiNW643Di8XkaeGedzt7L/VtNG+6iJ//fqpULwYktTSdlNzwvNdu8IJ70VmhTOxVWWTcBlJOQNkjHXcU/E3N7keieQo7yE1dWoignNqUrTOaQIOnLxbmfjWAsRsieMSPNRIRvboXJfA5oppZ5lhfiAkyfJV8rNzc9Yt+KWO9uLbdfYJjok7CnICzlPhn2Ho7NHpfqLpJiT/V52C8I0UDMEDBMxCDee2/zHqoTJzzdJpbsGG/6LaEiLoO6+GWnreeBLlPSCE3GmIB1sJGaqJ7Zyfo0/LdTnCM+R2QHh1ju4YGLk8EKsSYfmlDRuat+qCstjOAEmpz3OmJENRAmTMHDkyaPL5v0RuR4S9uN/mlvAEPhSn4w4CZwuWLEpHolG4Zb7ltTgTsE6k4NpWUo2tx/uSb/D4cVzWB4u4=
34+
skip_cleanup: true
3335
on:
3436
tags: true
3537
repo: watson-developer-cloud/speech-javascript-sdk

README.md

Lines changed: 20 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ This library is built with [browserify](http://browserify.org/) and easy to use
3232
Pre-compiled bundles are also available from on GitHub Releases: https://github.com/watson-developer-cloud/speech-javascript-sdk/releases
3333

3434
API
35-
---------
35+
---
3636

37-
The basic API is outlined here, see complete API docs at http://watson-developer-cloud.github.io/speech-javascript-sdk/
37+
The basic API is outlined here, see complete API docs at http://watson-developer-cloud.github.io/speech-javascript-sdk/master/
3838

3939
All API methods require an auth token that must be [generated server-side](https://github.com/watson-developer-cloud/node-sdk#authorization).
4040
(Snp teee examples/token-server.js for a basic example.)
4141

42-
## `WatsonSpeech.TextToSpeech`
42+
## [`WatsonSpeech.TextToSpeech`](http://watson-developer-cloud.github.io/speech-javascript-sdk/master/module-watson-speech_text-to-speech.html)
4343

44-
### `.synthesize({text, token})` -> `<audio>`
44+
### [`.synthesize({text, token})`](http://watson-developer-cloud.github.io/speech-javascript-sdk/master/module-watson-speech_text-to-speech_synthesize.html) -> `<audio>`
4545

4646
Speaks the supplied text through an automatically-created `<audio>` element.
4747
Currently limited to text that can fit within a GET URL (this is particularly an issue on [Internet Explorer before Windows 10](http://stackoverflow.com/questions/32267442/url-length-limitation-of-microsoft-edge)
@@ -53,89 +53,42 @@ Options:
5353
* autoPlay - set to false to prevent the audio from automatically playing
5454

5555

56-
## `WatsonSpeech.SpeechToText`
56+
## [`WatsonSpeech.SpeechToText`](http://watson-developer-cloud.github.io/speech-javascript-sdk/master/module-watson-speech_speech-to-text.html)
5757

5858

59-
### `.recognizeMicrophone({token})` -> `RecognizeStream`
59+
### [`.recognizeMicrophone({token})`](http://watson-developer-cloud.github.io/speech-javascript-sdk/master/module-watson-speech_speech-to-text_recognize_microphone.html) -> [`RecognizeStream`][RecognizeStream]
6060

6161
Options:
6262
* `keepMic`: if true, preserves the MicrophoneStream for subsequent calls, preventing additional permissions requests in Firefox
63-
* Other options passed to MediaElementAudioStream and RecognizeStream
64-
* Other options passed to WritableElementStream if `options.outputElement` is set
63+
* Other options passed to [RecognizeStream]
64+
* Other options passed to [WritableElementStream] if `options.outputElement` is set
6565

6666
Requires the `getUserMedia` API, so limited browser compatibility (see http://caniuse.com/#search=getusermedia)
6767
Also note that Chrome requires https (with a few exceptions for localhost and such) - see https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features
6868

69-
Pipes results through a `{FormatStream}` by default, set `options.format=false` to disable.
69+
Pipes results through a [FormatStream] by default, set `options.format=false` to disable.
7070

7171
Known issue: Firefox continues to display a microphone icon in the address bar after recording has ceased. This is a browser bug.
7272

73-
### `.recognizeFile({data, token})` -> `RecognizeStream`
73+
74+
### [`.recognizeFile({data, token})`](http://watson-developer-cloud.github.io/speech-javascript-sdk/master/module-watson-speech_speech-to-text_recognize_file.html) -> [`RecognizeStream`][RecognizeStream]
7475

7576
Can recognize and optionally attempt to play a [File](https://developer.mozilla.org/en-US/docs/Web/API/File) or [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
7677
(such as from an `<input type="file"/>` or from an ajax request.)
7778

7879
Options:
7980
* `data`: a `Blob` or `File` instance.
8081
* `play`: (optional, default=`false`) Attempt to also play the file locally while uploading it for transcription
81-
* Other options passed to RecognizeStream
82-
* Other options passed to WritableElementStream if `options.outputElement` is set
82+
* Other options passed to [RecognizeStream]
83+
* Other options passed to [WritableElementStream] if `options.outputElement` is set
8384

8485
`play`requires that the browser support the format; most browsers support wav and ogg/opus, but not flac.)
8586
Will emit a `playback-error` on the RecognizeStream if playback fails.
8687
Playback will automatically stop when `.stop()` is called on the RecognizeStream.
8788

88-
Pipes results through a `{TimingStream}` by if `options.play=true`, set `options.realtime=false` to disable.
89-
90-
Pipes results through a `{FormatStream}` by default, set `options.format=false` to disable.
91-
92-
### Class `RecognizeStream()`
93-
94-
A [Node.js-style stream](https://nodejs.org/api/stream.html) of the final text, with some helpers and extra events built in.
95-
96-
RecognizeStream is generally not instantiated directly but rather returned as the result of calling one of the recognize* methods.
97-
98-
The RecognizeStream waits until after receiving data to open a connection.
99-
If no `content-type` option is set, it will attempt to parse the first chunk of data to determine type.
100-
101-
See speech-to-text/recognize-stream.js for other options.
102-
103-
#### Methods
104-
105-
* `.promise()`: returns a promise that will resolve to the final text.
106-
Note that you must either set `continuous: false` or call `.stop()` on the stream to make the promise resolve in a timely manner.
107-
108-
* `.stop()`: stops the stream. No more data will be sent, but the stream may still receive additional results with the transcription of already-sent audio.
109-
Standard `close` event will fire once the underlying websocket is closed and `end` once all of the data is consumed.
110-
111-
#### Events
112-
Follows standard [Node.js stream events](https://nodejs.org/api/stream.html), in particular:
113-
114-
* `data`: emits either final Strings or final/interim result objects depending on if the stream is in objectMode
115-
* `end`: emitted once all data has been consumed.
89+
Pipes results through a [TimingStream] by if `options.play=true`, set `options.realtime=false` to disable.
11690

117-
(Note: there are several custom events, but they are deprecated or intended for internal usage)
118-
119-
### Class `FormatStream()`
120-
121-
Pipe a `RecognizeStream` to a format stream, and the resulting text and `results` events will have basic formatting applied:
122-
* Capitalize the first word of each sentence
123-
* Add a period to the end
124-
* Fix any "cruft" in the transcription
125-
* A few other tweaks for asian languages and such.
126-
127-
Inherits `.promise()` from the `RecognizeStream`.
128-
129-
130-
### Class `TimingStream()`
131-
132-
For use with `.recognizeFile({play: true})` - slows the results down to match the audio. Pipe in the `RecognizeStream` (or `FormatStream`) and listen for results as usual.
133-
134-
Inherits `.promise()` from the `RecognizeStream`.
135-
136-
### Class `WritableElementStream()`
137-
138-
Accepts input from `RecognizeStream()` and friends, writes text to supplied `outputElement`.
91+
Pipes results through a [FormatStream] by default, set `options.format=false` to disable.
13992

14093

14194
## Changelog
@@ -201,3 +154,8 @@ Accepts input from `RecognizeStream()` and friends, writes text to supplied `out
201154
* look for bug where single-word final results may omit word confidence (possibly due to FormatStream?)
202155
* fix bug where TimingStream shows words slightly before they're spoken
203156
* support jquery objects for element and targetElement
157+
158+
[RecognizeStream]: http://watson-developer-cloud.github.io/speech-javascript-sdk/master/RecognizeStream.html
159+
[TimingStream]: http://watson-developer-cloud.github.io/speech-javascript-sdk/master/TimingStream.html
160+
[FormatStream]: http://watson-developer-cloud.github.io/speech-javascript-sdk/master/FormatStream.html
161+
[WritableElementStream]: http://watson-developer-cloud.github.io/speech-javascript-sdk/master/WritableElementStream.html

0 commit comments

Comments
 (0)