Skip to content

Commit f04e859

Browse files
CallistoCFbeccasaurus
authored andcommitted
Code Samples for new v1p1beta1 features (#118)
* MicrophoneStreamTest, and basic .ava tests- * Just cosmetic, removed some notes, added note about Event style for test. * removed .test, cleaned up yaaarghs * Cleaned up test within MicStream.js, .ava tests forthcoming * Pruned down to core streaming function, yaargs rebuilt, .ava upcoming * newest .ava test, just makes sure yaargs loads, comments addressed * Added Readme * BetaFeatures for Test, fixed from yesterday * Updated Readme * Updated Readme, fixed old paths used in testing * Updated Readme again * Updated Yaargs Examples to fit readme * Fixed Diarization bug * Speech Fixes * fixing eslint settings to merge * eslint again * testing lint quick fix * more ESlint shennanigans * cleaned up region tags * Removed audiochannelGCS * Removed Comments, also multiChannel GCS * Removed Comments, GCS MultiChannel * Removed multi Audio Channel * Added mono-channel multi Language file to sample * removed old console.log * fixed todos and filename -> fileName * removed docstrings * removed enableWordTimeOffsets in WordLvlConfidence * rebuild * fixed space * fixed package.lock for node8 circleCI * Attempted fix for circleCI node 8 * attempted mime-types fix * possible mime/CLI fix * Merged Latest package chore stuff, for circleCI * all outstanding comments, except eslint issue * confidence test fix * fixed eslinting in betaFeatures.js * eslint again * Fixed MultiChannel transcribe * multiChannelGCS test * Updated readme * updated readme, scaffolding * readme again
1 parent 8671e7b commit f04e859

7 files changed

Lines changed: 100 additions & 4 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"program": "${workspaceFolder}/samples/betaFeatures.js"
12+
}
13+
]
14+
}

packages/google-cloud-speech/CONTRIBUTORS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,34 @@
66
Ace Nassri <anassri@google.com>
77
Alexander Fenster <fenster@google.com>
88
Ali Ijaz Sheikh <ofrobots@google.com>
9+
Chris Frater <cfrater@cfrater-macbookpro.roam.corp.google.com>
10+
Chris Frater <chrisfrater@gmail.com>
11+
Chris Frater <chrisfrater@google.com>
12+
Christopher Wilcox <crwilcox@google.com>
13+
Christopher Wilcox <git@crwilcox.com>
14+
DPE bot <dpebot@google.com>
915
Dan Aharon <daharon@google.com>
16+
Daniel Ruf <DanielRuf@users.noreply.github.com>
1017
Daryush Laqab <dalaqab@google.com>
1118
Dave Gramlich <callmehiphop@gmail.com>
1219
Eric Uldall <ericuldall@gmail.com>
1320
Ernest Landrito <landrito@google.com>
1421
Gus Class <class@google.com>
1522
Jason Dobry <jdobry@google.com>
1623
Jerjou <jerjou@users.noreply.github.com>
24+
Jonathan Lui <jonathanlui@google.com>
1725
Jun Mukai <mukai@google.com>
26+
Justin Beckwith <justin.beckwith@gmail.com>
1827
Luke Sneeringer <lukesneeringer@google.com>
1928
Philippe Sultan <philippe.sultan@gmail.com>
2029
Pierre Fritsch <PierreFritsch@users.noreply.github.com>
2130
Puneith Kaul <puneith@google.com>
2231
Rebecca Taylor <remilytaylor@gmail.com>
32+
Shahin <happyhuman@users.noreply.github.com>
2333
Song Wang <songwang@google.com>
2434
Stephen Sawchuk <sawchuk@gmail.com>
2535
Tim Swast <swast@google.com>
36+
cfrater <cfrater@cfrater-macbookpro.roam.corp.google.com>
2637
greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>
38+
renovate[bot] <renovate[bot]@users.noreply.github.com>
2739
wanacode <wanacode@users.noreply.github.com>

packages/google-cloud-speech/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
2+
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
13
<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"/>
24

35
# [Google Cloud Speech API: Node.js Client](https://github.com/googleapis/nodejs-speech)
@@ -145,4 +147,4 @@ See [LICENSE](https://github.com/googleapis/nodejs-speech/blob/master/LICENSE)
145147

146148
[client-docs]: https://cloud.google.com/nodejs/docs/reference/speech/latest/
147149
[product-docs]: https://cloud.google.com/speech/docs
148-
[shell_img]: //gstatic.com/cloudssh/images/open-btn.png
150+
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png

packages/google-cloud-speech/package-lock.json

100644100755
File mode changed.

packages/google-cloud-speech/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,36 @@
3232
"Ace Nassri <anassri@google.com>",
3333
"Alexander Fenster <fenster@google.com>",
3434
"Ali Ijaz Sheikh <ofrobots@google.com>",
35+
"Chris Frater <cfrater@cfrater-macbookpro.roam.corp.google.com>",
36+
"Chris Frater <chrisfrater@gmail.com>",
37+
"Chris Frater <chrisfrater@google.com>",
38+
"Christopher Wilcox <crwilcox@google.com>",
39+
"Christopher Wilcox <git@crwilcox.com>",
40+
"DPE bot <dpebot@google.com>",
3541
"Dan Aharon <daharon@google.com>",
42+
"Daniel Ruf <DanielRuf@users.noreply.github.com>",
3643
"Daryush Laqab <dalaqab@google.com>",
3744
"Dave Gramlich <callmehiphop@gmail.com>",
3845
"Eric Uldall <ericuldall@gmail.com>",
3946
"Ernest Landrito <landrito@google.com>",
4047
"Gus Class <class@google.com>",
4148
"Jason Dobry <jdobry@google.com>",
4249
"Jerjou <jerjou@users.noreply.github.com>",
50+
"Jonathan Lui <jonathanlui@google.com>",
4351
"Jun Mukai <mukai@google.com>",
52+
"Justin Beckwith <justin.beckwith@gmail.com>",
4453
"Luke Sneeringer <lukesneeringer@google.com>",
4554
"Philippe Sultan <philippe.sultan@gmail.com>",
4655
"Pierre Fritsch <PierreFritsch@users.noreply.github.com>",
4756
"Puneith Kaul <puneith@google.com>",
4857
"Rebecca Taylor <remilytaylor@gmail.com>",
58+
"Shahin <happyhuman@users.noreply.github.com>",
4959
"Song Wang <songwang@google.com>",
5060
"Stephen Sawchuk <sawchuk@gmail.com>",
5161
"Tim Swast <swast@google.com>",
62+
"cfrater <cfrater@cfrater-macbookpro.roam.corp.google.com>",
5263
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>",
64+
"renovate[bot] <renovate[bot]@users.noreply.github.com>",
5365
"wanacode <wanacode@users.noreply.github.com>"
5466
],
5567
"scripts": {

packages/google-cloud-speech/samples/README.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
2+
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
13
<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"/>
24

35
# Google Cloud Speech API: Node.js Samples
@@ -78,9 +80,12 @@ __Usage:__ `node recognize.v1p1beta1.js --help`
7880
recognize.v1p1beta1.js <command>
7981
8082
Commands:
81-
recognize.v1p1beta1.js sync-model <filename> <model> Detects speech in a local audio file using provided model.
82-
recognize.v1p1beta1.js sync-model-gcs <gcsUri> <model> Detects speech in an audio file located in a Google Cloud
83-
Storage bucket using provided model.
83+
recognize.v1p1beta1.js sync-model <filename> <model> Detects speech in a local audio file using provided model.
84+
recognize.v1p1beta1.js sync-model-gcs <gcsUri> <model> Detects speech in an audio file located in a Google Cloud
85+
Storage bucket using provided model.
86+
recognize.v1p1beta1.js sync-auto-punctuation <filename> Detects speech in a local audio file with auto punctuation.
87+
recognize.v1p1beta1.js sync-metadata <filename> Detects speech in a local audio file with metadata.
88+
recognize.v1p1beta1.js sync-enhanced-model <filename> Detects speech in a local audio file using an enhanced model.
8489
8590
Options:
8691
--version Show version number [boolean]
@@ -92,12 +97,63 @@ Options:
9297
Examples:
9398
node recognize.v1p1beta1.js sync-model ./resources/Google_Gnome.wav video -e LINEAR16 -r 16000
9499
node recognize.v1p1beta1.js sync-model-gcs gs://gcs-test-data/Google_Gnome.wav phone_call -e FLAC -r 16000
100+
node recognize.v1p1beta1.js sync-auto-punctuation ./resources/commercial_mono.wav
101+
node recognize.v1p1beta1.js sync-metadata ./resources/commercial_mono.wav
102+
node recognize.v1p1beta1.js sync-enhanced-model ./resources/commercial_mono.wav
95103
96104
For more information, see https://cloud.google.com/speech/docs
97105
```
98106

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

110+
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
111+
[shell_img]: //gstatic.com/cloudssh/images/open-btn.png
112+
[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
113+
114+
### Speech Recognition betaFeatures
115+
116+
View the [source code][betaFeatures_code].
117+
118+
[![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/betaFeatures.js,samples/README.md)
119+
120+
__Usage:__ `node betaFeatures.js --help`
121+
122+
```
123+
betaFeatures.js <command>
124+
125+
Commands:
126+
betaFeatures.js Diarization Isolate distinct speakers in an audio file
127+
betaFeatures.js DiarizationGCS Isolate distinct speakers in an audio file located in a Google Cloud
128+
Storage bucket.
129+
betaFeatures.js multiChannelTranscribe Differentiates input by audio channel in local audio file.
130+
betaFeatures.js multiChannelTranscribeGCS Differentiates input by audio channe from GCS audio file.
131+
betaFeatures.js multiLanguageTranscribe Transcribes multiple languages from local audio file.
132+
betaFeatures.js multiLanguageTranscribeGCS Transcribes multiple languages from GCS audio file.
133+
betaFeatures.js wordLevelConfidence Detects word level confidence from local audio file.
134+
betaFeatures.js wordLevelConfidenceGCS Detects word level confidence from GCS audio file.
135+
136+
Options:
137+
--version Show version number [boolean]
138+
--speechFile, -f [string]
139+
--gcsUri, -u [string]
140+
--help Show help [boolean]
141+
142+
Examples:
143+
node betaFeatures.js Diarization -f ./resources/commercial_mono.wav
144+
node betaFeatures.js DiarizationGCS -u gs://cloud-samples-tests/speech/commercial_mono.wav
145+
node betaFeatures.js multiChannelTranscribe -f ./resources/commercial_stereo.wav
146+
node betaFeatures.js multiChannelTranscribeGCS -u gs://cloud-samples-tests/speech/commercial_stereo.wav
147+
node betaFeatures.js multiLanguageTranscribe -f ./resources/multi.wav
148+
node betaFeatures.js multiLanguageTranscribeGCS -u gs://nodejs-docs-samples/multi_mono.wav
149+
node betaFeatures.js wordLevelConfidence -f ./resources/brooklyn.flac
150+
node betaFeatures.js wordLevelConfidenceGCS -u gs://cloud-samples-tests/speech/brooklyn.flac
151+
152+
For more information, see https://cloud.google.com/speech/docs
153+
```
154+
155+
[betaFeatures_docs]: https://cloud.google.com/speech/docs
156+
[betaFeatures_code]: recognize.v1p1beta1.js
157+
102158
[shell_img]: //gstatic.com/cloudssh/images/open-btn.png
103159
[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

packages/google-cloud-speech/samples/package.json

100644100755
File mode changed.

0 commit comments

Comments
 (0)