Skip to content

Commit 2e0a50c

Browse files
committed
enabling interim_results in text mode for the side-effect of faster final results
1 parent 24935f4 commit 2e0a50c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/static/microphone-streaming-object-to-console.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h2>Code for this demo:</h2>
3131

3232
var stream = WatsonSpeech.SpeechToText.recognizeMicrophone({
3333
token: token,
34-
objectMode: true // send objects instead of text
34+
objectMode: true // send objects instead of text
3535
});
3636

3737
stream.on('data', function(data) {

speech-to-text/recognize-stream.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ var QUERY_PARAMS_ALLOWED = ['model', 'watson-token']; // , 'X-Watson-Learning-Op
110110
* @param {String} [options.model='en-US_BroadbandModel'] - voice model to use. Microphone streaming only supports broadband models.
111111
* @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] base URL for service
112112
* @param {String} [options.content-type='audio/wav'] - content type of audio; can be automatically determined from file header in most cases. only wav, flac, and ogg/opus are supported
113-
* @param {Boolean} [options.interim_results=false] - Send back non-final previews of each "sentence" as it is being processed. Defaults to true when in objectMode.
113+
* @param {Boolean} [options.interim_results=true] - Send back non-final previews of each "sentence" as it is being processed. These results are ignored in text mode.
114114
* @param {Boolean} [options.continuous=true] - set to false to automatically stop the transcription after the first "sentence"
115115
* @param {Boolean} [options.word_confidence=false] - include confidence scores with results. Defaults to true when in objectMode.
116116
* @param {Boolean} [options.timestamps=false] - include timestamps with results. Defaults to true when in objectMode.
@@ -183,7 +183,7 @@ RecognizeStream.prototype.initialize = function() {
183183
'content-type': 'audio/wav',
184184
continuous: true,
185185
inactivity_timeout: 30,
186-
interim_results: false,
186+
interim_results: true,
187187
word_confidence: false,
188188
timestamps: false,
189189
max_alternatives: 1

0 commit comments

Comments
 (0)