Transcribe live audio using Google Cloud Speech to Text API
The script provides a workaround for the 60s time limit restriction posed by Google Cloud Speech to Text API.
The script stages the the audio/microphone input into a buffer before transcribing the "audio chunks" from the buffer using the API. That way, when the existing API client returns a time out error it is simply reinitialized and the new client will continue transcribing the audio from the buffer.
Do not forget to configure environment variable GOOGLE_APPLICATION_CREDENTIALS
with the GCP credentails JSON file path
export GOOGLE_APPLICATION_CREDENTIALS='/path/to/credentials.json'
npm install
node transcribe.js -h
node transcribe.js -e LINEAR16 -r 16000 -l hi-IN