-
-
Save evancohen/e525e9065888f295e3f8e8df5d478d5b to your computer and use it in GitHub Desktop.
Mac OS gRPC crash with no network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ROOT_DIR = __dirname + '/../' | |
const record = require('node-record-lpcm16') | |
const speech = require('@google-cloud/speech')({ | |
projectId: 'streaming-speech-sample', | |
keyFilename: ROOT_DIR + 'keyfile.json' | |
}) | |
recording = record.start({ | |
threshold: 0, | |
recordProgram: "rec", | |
verbose: false | |
}) | |
const recognitionStream = speech.createRecognizeStream({ | |
config: { | |
encoding: 'LINEAR16', | |
sampleRateHertz: 16000, | |
languageCode: "en-US" | |
}, | |
singleUtterance: true, | |
interimResults: true, | |
verbose: true | |
}) | |
recognitionStream.on('error', console.log) | |
recognitionStream.on('data', console.log) | |
recording.pipe(recognitionStream) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment