<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
npm install google-cloud-speech![Build]()
The Cloud Speech API enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Cloud Speech API service.
* Setup
* Samples
* Speech Recognition
* Running the tests
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
1. Install dependencies:
With npm:
npm install
With yarn:
yarn install
[prereq]: ../README.md#prerequisites
[run]: ../README.md#how-to-run-a-sample
View the [documentation][recognize_0_docs] or the [source code][recognize_0_code].
__Usage:__ node recognize.js --help
``
Commands:
sync
sync-gcs
sync-words
async
async-gcs
and waits for the job to complete.
async-gcs-words
Cloud Storage bucket, and waits for the job to complete.
stream
listen Detects speech in a microphone input stream. This command requires that you have SoX
installed and available in your $PATH. See
https://www.npmjs.com/package/node-record-lpcm16#dependencies
Options:
--help Show help [boolean]
--encoding, -e [string] [default: "LINEAR16"]
--sampleRateHertz, -r [number] [default: 16000]
--languageCode, -l [string] [default: "en-US"]
Examples:
node recognize.js sync ./resources/audio.raw -e LINEAR16 -r 16000
node recognize.js async-gcs gs://gcs-test-data/vr.flac -e FLAC -r 16000
node recognize.js stream ./resources/audio.raw -e LINEAR16 -r 16000
node recognize.js listen
For more information, see https://cloud.google.com/speech/docs
``
[recognize_0_docs]: https://cloud.google.com/speech/docs
[recognize_0_code]: recognize.js
1. Set the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS environment variables.
1. Run the tests:
With npm:
npm test
With yarn:
yarn test