Speech to Text - Streaming
// 1) | |
async function transcribeAudioStream(audio, cb) { | |
// 2) | |
const recognizeStream = speechClient.streamingRecognize(request) | |
// 3) | |
.on('data', function(data){ | |
console.log(data); | |
cb(data); | |
}) | |
// 4) | |
.on('error', (e) => { | |
console.log(e); | |
}) | |
.on('end', () => { | |
console.log('on end'); | |
}); | |
// 5) | |
audio.pipe(recognizeStream); | |
audio.on('end', function() { }); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment