You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-20Lines changed: 16 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Options:
46
46
47
47
Requires that the browser support MediaElement and whatever audio codec is used in your media file.
48
48
49
-
Will automatically call `.play()` the `element`, set `options.autoplay=false` to disable. Calling `.stop()` on the returned stream will automatically call `.stop()` on the `element`.
49
+
Will automatically call `.play()` the `element`, set `options.autoPlay=false` to disable. Calling `.stop()` on the returned stream will automatically call `.stop()` on the `element`.
50
50
51
51
Pipes results through a `{FormatStream}` by default, set `options.format=false` to disable.
52
52
@@ -85,13 +85,12 @@ See speech-to-text/recognize-stream.js for other options.
85
85
Standard `close` event will fire once the underlying websocket is closed and `end` once all of the data is consumed.
86
86
87
87
#### Events
88
-
In addition to the standard [Node.js stream events](https://nodejs.org/api/stream.html), the following events are fired:
88
+
Follows standard [Node.js stream events](https://nodejs.org/api/stream.html), in particular:
89
89
90
-
*`result`: an individual result object from the results array.
91
-
May include final or interim transcription, alternatives, word timing, confidence scores, etc. depending on passed in options.
92
-
Note: Listening for `result` will automatically put the stream into flowing mode.
90
+
*`data`: emits either final Strings or final/interim result objects depending on if the stream is in objectMode
91
+
*`end`: emitted once all data has been consumed.
93
92
94
-
(Note: there are several other events, but they are intended for internal usage)
93
+
(Note: there are several custom events, but they are deprecated or intended for internal usage)
95
94
96
95
### Class `FormatStream()`
97
96
@@ -101,18 +100,20 @@ Pipe a `RecognizeStream` to a format stream, and the resulting text and `results
101
100
* Fix any "cruft" in the transcription
102
101
* A few other tweaks for asian languages and such.
103
102
104
-
Inherits `.promise()`and `.stop()` methods and `result` event from the `RecognizeStream`.
103
+
Inherits `.promise()` from the `RecognizeStream`.
105
104
106
105
107
106
### Class `TimingStream()`
108
107
109
108
For use with `.recognizeBlob({play: true})` - slows the results down to match the audio. Pipe in the `RecognizeStream` (or `FormatStream`) and listen for results as usual.
110
109
111
-
Inherits `.stop()` method and `result` event from the `RecognizeStream`.
112
-
113
110
114
111
## Changelog
115
112
113
+
### v0.8
114
+
* deprecated `result` events in favor of `objectMode`.
115
+
* renamed the `autoplay` option to `autoPlay` on `recognizeElement()` (capital P)
116
+
116
117
### v0.7
117
118
* Changed `playFile` option of `recognizeBlob()` to just `play`, corrected default
118
119
* Added `options.format=true` to `recognize*()` to pipe text through a FormatStream
@@ -125,21 +126,16 @@ Inherits `.stop()` method and `result` event from the `RecognizeStream`.
125
126
## todo
126
127
127
128
* Solidify API
128
-
* support objectMode instead of having random events
129
-
* add text-to-speech support
129
+
* add text-to-speech support - may require service improvements
130
130
* add an example that includes alternatives and word confidence scores
Copy file name to clipboardExpand all lines: test/resources/integration_test_server.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
varfs=require('fs');
2
2
varwatson=require('watson-developer-cloud');
3
3
4
-
varAUTH_FILE=__dirname+'/auth.json';
4
+
varAUTH_FILE=__dirname+'/stt-auth.json';
5
5
6
6
if(!fs.existsSync(AUTH_FILE)){
7
7
console.error('Missing required test/resources/auth.json for integration test - see https://github.com/watson-developer-cloud/node-sdk#getting-the-service-credentials');
0 commit comments