Skip to content

Commit

Permalink
Add Speech Recognition v1p1beta1 samples (#33)
Browse files Browse the repository at this point in the history
* Add Speech Recognition v1p1beta1 samples

* Upgrade eslint-plugin-prettier to ^2.6.0
  • Loading branch information
beccasaurus authored Feb 26, 2018
1 parent e87d846 commit a18c0f9
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/google-cloud-node/.cloud-repo-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"file": "recognize.js",
"docs_link": "https://cloud.google.com/speech/docs",
"usage": "node recognize.js --help"
},
{
"id": "recognize.v1p1beta1",
"name": "Speech Recognition v1p1beta1",
"file": "recognize.v1p1beta1.js",
"docs_link": "https://cloud.google.com/speech/docs",
"usage": "node recognize.v1p1beta1.js --help"
}
]
}
1 change: 1 addition & 0 deletions packages/google-cloud-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ has instructions for running the samples.
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Speech Recognition | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/recognize.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/recognize.js,samples/README.md) |
| Speech Recognition v1p1beta1 | [source code](https://github.com/googleapis/nodejs-speech/blob/master/samples/recognize.v1p1beta1.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/recognize.v1p1beta1.js,samples/README.md) |

The [Speech API Node.js Client API Reference][client-docs] documentation
also contains samples.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"eslint": "^4.10.0",
"eslint-config-prettier": "^2.7.0",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-prettier": "^2.6.0",
"ink-docstrap": "^1.3.0",
"intelli-espower-loader": "^1.0.1",
"jsdoc": "^3.5.5",
Expand Down
34 changes: 34 additions & 0 deletions packages/google-cloud-node/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The [Cloud Speech API](https://cloud.google.com/speech/docs) enables easy integr
* [Before you begin](#before-you-begin)
* [Samples](#samples)
* [Speech Recognition](#speech-recognition)
* [Speech Recognition v1p1beta1](#speech-recognition-v1p1beta1)

## Before you begin

Expand Down Expand Up @@ -65,5 +66,38 @@ For more information, see https://cloud.google.com/speech/docs
[recognize_0_docs]: https://cloud.google.com/speech/docs
[recognize_0_code]: recognize.js

### Speech Recognition v1p1beta1

View the [source code][recognize.v1p1beta1_1_code].

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/recognize.v1p1beta1.js,samples/README.md)

__Usage:__ `node recognize.v1p1beta1.js --help`

```
recognize.v1p1beta1.js <command>
Commands:
recognize.v1p1beta1.js sync-model <filename> <model> Detects speech in a local audio file using provided model.
recognize.v1p1beta1.js sync-model-gcs <gcsUri> <model> Detects speech in an audio file located in a Google Cloud
Storage bucket using provided model.
Options:
--version Show version number [boolean]
--encoding, -e [string] [default: "LINEAR16"]
--sampleRateHertz, -r [number] [default: 16000]
--languageCode, -l [string] [default: "en-US"]
--help Show help [boolean]
Examples:
node recognize.v1p1beta1.js sync-model ./resources/Google_Gnome.wav video -e LINEAR16 -r 16000
node recognize.v1p1beta1.js sync-model-gcs gs://gcs-test-data/Google_Gnome.wav phone_call -e FLAC -r 16000
For more information, see https://cloud.google.com/speech/docs
```

[recognize.v1p1beta1_1_docs]: https://cloud.google.com/speech/docs
[recognize.v1p1beta1_1_code]: recognize.v1p1beta1.js

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-speech&page=editor&open_in_editor=samples/README.md

0 comments on commit a18c0f9

Please sign in to comment.