diff --git a/services/speech_to_text/v1.js b/services/speech_to_text/v1.js index 807b4b39ad..96c7f0c28c 100644 --- a/services/speech_to_text/v1.js +++ b/services/speech_to_text/v1.js @@ -465,8 +465,8 @@ function RecognizeStream(options){ } } else if (data.results) { self.emit('results', data); - // note: currently there is always exactly 1 entry in the results array. However, this may change in the future. - if(data.results[0].final && data.results[0].alternatives) { + // note: usually exactly 1 entry in results. Edge case: zero entries. E.g., silent audio sent from pipeline + if(data.results[0] && data.results[0].final && data.results[0].alternatives) { self.push(data.results[0].alternatives[0].transcript, 'utf8'); // this is the "data" event that can be easily piped to other streams } } else {