Skip to content

Commit 30e91c1

Browse files
committed
end stream when mic access is not avaliable
1 parent 59d4726 commit 30e91c1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
### v0.27.1
4+
* stream from recognizeMicrophone emits an `end` event when microphone access is not avaliable
5+
36
### v0.27.0
47
* TimingStream rewrite - now emits exact results received from the service, always in the exact order recieved
58
* old version created extra interim results and could emit speaker_labels before their matching final result in certain circumstances

speech-to-text/recognize-microphone.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ module.exports = function recognizeMicrophone(options) {
132132

133133
getMicStream.catch(function(err) {
134134
stream.emit('error', err);
135+
if (err.name == 'NotSupportedError') {
136+
stream.end(); // end the stream
137+
}
135138
});
136139

137140
getMicStream.then(function(micStream) {

0 commit comments

Comments
 (0)