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
* recognize stream now uses service defaults
* moved non-default settings to recognizeFile/Microphone() helper methods
* fixed bug with recognizeStream autodetecting file content-type
@@ -140,14 +139,21 @@ var QUERY_PARAMS_ALLOWED = [
140
139
* @param {Number} [options.word_alternatives_threshold] - Number between 0 and 1 representing the minimum confidence before including an alternative word in the results. Must be set to enable word alternatives,
141
140
* @param {Boolean} [options.profanity_filter=false] - set to true to filter out profanity and replace the words with *'s
142
141
* @param {Number} [options.inactivity_timeout=30] - how many seconds of silence before automatically closing the stream (even if continuous is true). use -1 for infinity
143
-
* @param {Boolean} [options.readableObjectMode=false] - emit `result` objects instead of string Buffers for the `data` events. Changes several other defaults.
142
+
* @param {Boolean} [options.readableObjectMode=false] - emit `result` objects instead of string Buffers for the `data` events. Does not affect input (which must be binary)
143
+
* @param {Boolean} [options.objectMode=false] - alias for options.readableObjectMode
144
144
* @param {Number} [options.X-Watson-Learning-Opt-Out=false] - set to true to opt-out of allowing Watson to use this request to improve it's services
145
145
* @param {Boolean} [options.smart_formatting=false] - formats numeric values such as dates, times, currency, etc.
146
146
* @param {String} [options.customization_id] - not yet supported on the public STT service
147
147
*
148
148
* @constructor
149
149
*/
150
150
functionRecognizeStream(options){
151
+
// this stream only supports objectMode on the output side.
152
+
// It must receive binary data input.
153
+
if(options.objectMode){
154
+
options.readableObjectMode=true;
155
+
deleteoptions.objectMode;
156
+
}
151
157
Duplex.call(this,options);
152
158
this.options=options;
153
159
this.listening=false;
@@ -161,7 +167,7 @@ function RecognizeStream(options) {
0 commit comments