Skip to content

Commit

Permalink
replace endpointerType with speechEventType (google.cloud.speech.v1be…
Browse files Browse the repository at this point in the history
…ta1 to v1)
  • Loading branch information
matrixOperator authored and evancohen committed May 15, 2017
1 parent 473e4f6 commit e1bf052
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ CloudSpeechRecognizer.startStreaming = (options, audioStream, cloudSpeechRecogni
recognitionStream.on('data', data => {
if (data) {
cloudSpeechRecognizer.emit('data', data)
if (data.endpointerType === 'END_OF_UTTERANCE') {
if (data.speechEventType === 'END_OF_SINGLE_UTTERANCE') {
cloudSpeechRecognizer.listening = false
audioStream.unpipe(recognitionStream)
}
Expand Down Expand Up @@ -107,7 +107,7 @@ Sonus.init = (options, recognizer) => {
} else {
sonus.emit('partial-result', result.transcript)
}
} else if (data.endpointerType === 'END_OF_UTTERANCE' && transcriptEmpty) {
} else if (data.speechEventType === 'END_OF_SINGLE_UTTERANCE' && transcriptEmpty) {
sonus.emit('final-result', "")
}
})
Expand Down

0 comments on commit e1bf052

Please sign in to comment.