From 25ed5669e0c943cff10b2b330a69e4ff4d007de1 Mon Sep 17 00:00:00 2001 From: Alex Sikand Date: Tue, 6 Jun 2017 13:00:25 -0700 Subject: [PATCH] Change EndpointerType to match new API --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b6d4a81..089b9b0 100644 --- a/index.js +++ b/index.js @@ -43,7 +43,7 @@ CloudSpeechRecognizer.startStreaming = (options, audioStream, cloudSpeechRecogni recognitionStream.on('data', data => { if (data) { cloudSpeechRecognizer.emit('data', data) - if (data.speechEventType === 'END_OF_SINGLE_UTTERANCE') { + if (data.speechEventType === 'END_OF_UTTERANCE') { cloudSpeechRecognizer.listening = false audioStream.unpipe(recognitionStream) } @@ -107,7 +107,7 @@ Sonus.init = (options, recognizer) => { } else { sonus.emit('partial-result', result.transcript) } - } else if (data.speechEventType === 'END_OF_SINGLE_UTTERANCE' && transcriptEmpty) { + } else if (data.speechEventType === 'END_OF_UTTERANCE' && transcriptEmpty) { sonus.emit('final-result', "") } else if (data.error) { sonus.emit('error', data.error)