Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Code Samples for new v1p1beta1 features (#118)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
CallistoCF authored and beccasaurus committed Jul 31, 2018
1 parent 22246e5 commit 06b3ec7
Show file tree
Hide file tree
Showing 18 changed files with 743 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/samples/betaFeatures.js"
}
]
}
12 changes: 12 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,34 @@
Ace Nassri <anassri@google.com>
Alexander Fenster <fenster@google.com>
Ali Ijaz Sheikh <ofrobots@google.com>
Chris Frater <cfrater@cfrater-macbookpro.roam.corp.google.com>
Chris Frater <chrisfrater@gmail.com>
Chris Frater <chrisfrater@google.com>
Christopher Wilcox <crwilcox@google.com>
Christopher Wilcox <git@crwilcox.com>
DPE bot <dpebot@google.com>
Dan Aharon <daharon@google.com>
Daniel Ruf <DanielRuf@users.noreply.github.com>
Daryush Laqab <dalaqab@google.com>
Dave Gramlich <callmehiphop@gmail.com>
Eric Uldall <ericuldall@gmail.com>
Ernest Landrito <landrito@google.com>
Gus Class <class@google.com>
Jason Dobry <jdobry@google.com>
Jerjou <jerjou@users.noreply.github.com>
Jonathan Lui <jonathanlui@google.com>
Jun Mukai <mukai@google.com>
Justin Beckwith <justin.beckwith@gmail.com>
Luke Sneeringer <lukesneeringer@google.com>
Philippe Sultan <philippe.sultan@gmail.com>
Pierre Fritsch <PierreFritsch@users.noreply.github.com>
Puneith Kaul <puneith@google.com>
Rebecca Taylor <remilytaylor@gmail.com>
Shahin <happyhuman@users.noreply.github.com>
Song Wang <songwang@google.com>
Stephen Sawchuk <sawchuk@gmail.com>
Tim Swast <swast@google.com>
cfrater <cfrater@cfrater-macbookpro.roam.corp.google.com>
greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>
renovate[bot] <renovate[bot]@users.noreply.github.com>
wanacode <wanacode@users.noreply.github.com>
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
<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"/>

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

[client-docs]: https://cloud.google.com/nodejs/docs/reference/speech/latest/
[product-docs]: https://cloud.google.com/speech/docs
[shell_img]: //gstatic.com/cloudssh/images/open-btn.png
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
Empty file modified package-lock.json
100644 → 100755
Empty file.
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,36 @@
"Ace Nassri <anassri@google.com>",
"Alexander Fenster <fenster@google.com>",
"Ali Ijaz Sheikh <ofrobots@google.com>",
"Chris Frater <cfrater@cfrater-macbookpro.roam.corp.google.com>",
"Chris Frater <chrisfrater@gmail.com>",
"Chris Frater <chrisfrater@google.com>",
"Christopher Wilcox <crwilcox@google.com>",
"Christopher Wilcox <git@crwilcox.com>",
"DPE bot <dpebot@google.com>",
"Dan Aharon <daharon@google.com>",
"Daniel Ruf <DanielRuf@users.noreply.github.com>",
"Daryush Laqab <dalaqab@google.com>",
"Dave Gramlich <callmehiphop@gmail.com>",
"Eric Uldall <ericuldall@gmail.com>",
"Ernest Landrito <landrito@google.com>",
"Gus Class <class@google.com>",
"Jason Dobry <jdobry@google.com>",
"Jerjou <jerjou@users.noreply.github.com>",
"Jonathan Lui <jonathanlui@google.com>",
"Jun Mukai <mukai@google.com>",
"Justin Beckwith <justin.beckwith@gmail.com>",
"Luke Sneeringer <lukesneeringer@google.com>",
"Philippe Sultan <philippe.sultan@gmail.com>",
"Pierre Fritsch <PierreFritsch@users.noreply.github.com>",
"Puneith Kaul <puneith@google.com>",
"Rebecca Taylor <remilytaylor@gmail.com>",
"Shahin <happyhuman@users.noreply.github.com>",
"Song Wang <songwang@google.com>",
"Stephen Sawchuk <sawchuk@gmail.com>",
"Tim Swast <swast@google.com>",
"cfrater <cfrater@cfrater-macbookpro.roam.corp.google.com>",
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>",
"renovate[bot] <renovate[bot]@users.noreply.github.com>",
"wanacode <wanacode@users.noreply.github.com>"
],
"scripts": {
Expand Down
62 changes: 59 additions & 3 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
<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"/>

# Google Cloud Speech API: Node.js Samples
Expand Down Expand Up @@ -78,9 +80,12 @@ __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.
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.
recognize.v1p1beta1.js sync-auto-punctuation <filename> Detects speech in a local audio file with auto punctuation.
recognize.v1p1beta1.js sync-metadata <filename> Detects speech in a local audio file with metadata.
recognize.v1p1beta1.js sync-enhanced-model <filename> Detects speech in a local audio file using an enhanced model.
Options:
--version Show version number [boolean]
Expand All @@ -92,12 +97,63 @@ Options:
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
node recognize.v1p1beta1.js sync-auto-punctuation ./resources/commercial_mono.wav
node recognize.v1p1beta1.js sync-metadata ./resources/commercial_mono.wav
node recognize.v1p1beta1.js sync-enhanced-model ./resources/commercial_mono.wav
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]: https://gstatic.com/cloudssh/images/open-btn.png
[shell_img]: //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

### Speech Recognition betaFeatures

View the [source code][betaFeatures_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/betaFeatures.js,samples/README.md)

__Usage:__ `node betaFeatures.js --help`

```
betaFeatures.js <command>
Commands:
betaFeatures.js Diarization Isolate distinct speakers in an audio file
betaFeatures.js DiarizationGCS Isolate distinct speakers in an audio file located in a Google Cloud
Storage bucket.
betaFeatures.js multiChannelTranscribe Differentiates input by audio channel in local audio file.
betaFeatures.js multiChannelTranscribeGCS Differentiates input by audio channe from GCS audio file.
betaFeatures.js multiLanguageTranscribe Transcribes multiple languages from local audio file.
betaFeatures.js multiLanguageTranscribeGCS Transcribes multiple languages from GCS audio file.
betaFeatures.js wordLevelConfidence Detects word level confidence from local audio file.
betaFeatures.js wordLevelConfidenceGCS Detects word level confidence from GCS audio file.
Options:
--version Show version number [boolean]
--speechFile, -f [string]
--gcsUri, -u [string]
--help Show help [boolean]
Examples:
node betaFeatures.js Diarization -f ./resources/commercial_mono.wav
node betaFeatures.js DiarizationGCS -u gs://cloud-samples-tests/speech/commercial_mono.wav
node betaFeatures.js multiChannelTranscribe -f ./resources/commercial_stereo.wav
node betaFeatures.js multiChannelTranscribeGCS -u gs://cloud-samples-tests/speech/commercial_stereo.wav
node betaFeatures.js multiLanguageTranscribe -f ./resources/multi.wav
node betaFeatures.js multiLanguageTranscribeGCS -u gs://nodejs-docs-samples/multi_mono.wav
node betaFeatures.js wordLevelConfidence -f ./resources/brooklyn.flac
node betaFeatures.js wordLevelConfidenceGCS -u gs://cloud-samples-tests/speech/brooklyn.flac
For more information, see https://cloud.google.com/speech/docs
```

[betaFeatures_docs]: https://cloud.google.com/speech/docs
[betaFeatures_code]: recognize.v1p1beta1.js

[shell_img]: //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
Loading

0 comments on commit 06b3ec7

Please sign in to comment.