Skip to content

Commit 9d3efef

Browse files
Fixed issue 17
Test Results: 06 10 2016 14:37:35.466:INFO [http.server]: Starting 06 10 2016 14:37:35.653:INFO [http.server]: setting up token & api servers for offline test 06 10 2016 14:37:35.661:INFO [http.server]: Done 06 10 2016 14:37:38.401:INFO [framework.browserify]: bundle built 06 10 2016 14:37:38.410:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/ 06 10 2016 14:37:38.455:INFO [launcher]: Starting browser Chrome 06 10 2016 14:37:38.470:INFO [launcher]: Starting browser Firefox 06 10 2016 14:37:40.479:INFO [Chrome 53.0.2785 (Windows 8.1 0.0.0)]: Connected on socket /#rQhlCPoV5U0vgIBxAAAA with id 54488429 Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 0 of 19 SUCCESS (0 secs / 0 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 0 of 19 SUCCESS (0 secs / 0 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 1 of 19 SUCCESS (0 secs / 8.045 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 2 of 19 SUCCESS (0 secs / 8.153 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Firefox 49.0.0 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.584 secs / 8.544 secs) TOTAL: 38 SUCCESS fixed the issue 17. Test Results 06 10 2016 14:37:35.466:INFO [http.server]: Starting 06 10 2016 14:37:35.653:INFO [http.server]: setting up token & api servers for offline test 06 10 2016 14:37:35.661:INFO [http.server]: Done 06 10 2016 14:37:38.401:INFO [framework.browserify]: bundle built 06 10 2016 14:37:38.410:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/ 06 10 2016 14:37:38.455:INFO [launcher]: Starting browser Chrome 06 10 2016 14:37:38.470:INFO [launcher]: Starting browser Firefox 06 10 2016 14:37:40.479:INFO [Chrome 53.0.2785 (Windows 8.1 0.0.0)]: Connected on socket /#rQhlCPoV5U0vgIBxAAAA with id 54488429 Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 0 of 19 SUCCESS (0 secs / 0 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 0 of 19 SUCCESS (0 secs / 0 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 1 of 19 SUCCESS (0 secs / 8.045 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 2 of 19 SUCCESS (0 secs / 8.153 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Chrome 53.0.2785 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.319 secs / 8.278 secs) Firefox 49.0.0 (Windows 8.1 0.0.0): Executed 19 of 19 SUCCESS (8.584 secs / 8.544 secs) TOTAL: 38 SUCCESS
1 parent 01e74d5 commit 9d3efef

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

speech-to-text/recognize-microphone.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ module.exports = function recognizeMicrophone(options) {
141141

142142
}).catch(recognizeStream.emit.bind(recognizeStream, 'error'));
143143

144+
/**
145+
* Propagate error to new FormatStream
146+
*
147+
* @param {String} error message
148+
*/
149+
function handleError(error) {
150+
stream.emit('error', error);
151+
}
152+
153+
// Capture error from original RecognizeStream
154+
recognizeStream.on('error', handleError);
144155

145156
return stream;
146157
};

speech-to-text/recognize-stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ RecognizeStream.prototype.finish = function finish() {
404404
this.finished = true;
405405
var self = this;
406406
var closingMessage = {action: 'stop'};
407-
if (self.socket && self.socket.readyState !== self.socket.CLOSED && self.socket.readyState !== self.socket.CLOSING) {
407+
if (self.socket && self.socket.readyState === self.socket.OPEN) {
408408
self.sendJSON(closingMessage);
409409
} else {
410410
this.once('connect', function() {

0 commit comments

Comments
 (0)