Skip to content

Commit c1b828d

Browse files
committed
expose recognizeStream unconditionally
1 parent cd5f30c commit c1b828d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* RecognizeStream no longer sets any default options
66
* recognizeMicrophone() and recognizeFile() methods now do set default options that were previously set by RecognizeStream
77
* added new 'message' event to RecognizeStream that emits any message received over the WebSocket (mainly for debugging and demo usage)
8+
* exposed recognizeStream property on any stream returned from recognizeMicrophone() or recognizeFile() (for debugging)
89

910
### v0.24.0
1011
* Renamed `ResultExtractor` to `ResultStream`, exposed it in speech-to-text/index.js

speech-to-text/recognize-file.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,7 @@ module.exports = function recognizeFile(options) { // eslint-disable-line comple
148148
}
149149

150150
// expose the original stream to for debugging (and to support the JSON tab on the STT demo)
151-
if (stream !== recognizeStream) {
152-
stream.recognizeStream = recognizeStream;
153-
}
154-
151+
stream.recognizeStream = recognizeStream;
155152

156153
return stream;
157154
};

speech-to-text/recognize-microphone.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ module.exports = function recognizeMicrophone(options) {
181181
if (stream !== recognizeStream) {
182182
// add a stop button to whatever the final stream ends up being
183183
stream.stop = recognizeStream.stop.bind(recognizeStream);
184-
185-
// expose the original stream to for debugging (and to support the JSON tab on the STT demo)
186-
stream.recognizeStream = recognizeStream;
187184
}
188185

186+
// expose the original stream to for debugging (and to support the JSON tab on the STT demo)
187+
stream.recognizeStream = recognizeStream;
188+
189189
return stream;
190190
};
191191

0 commit comments

Comments
 (0)