I'm working with the MicrophoneStream example and am successfully getting the transcription to show what I've said.
I'd like to work with this string in numerous ways, but I can't seem to figure out how to return the data gathered from this section of code:
const recognizeStream = client
.streamingRecognize(request)
.on('error', console.error)
.on('data', data => {
process.stdout.write(
data.results[0] && data.results[0].alternatives[0]
? `Transcription: ${data.results[0].alternatives[0].transcript}\n`
: '\n\nReached transcription time limit, press Ctrl+C\n'
)
})