Skip to content

Commit

Permalink
Upgrade Speech samples. (#217)
Browse files Browse the repository at this point in the history
* Upgrade Speech samples.

* Address comments.
  • Loading branch information
jmdobry authored and Ace Nassri committed Sep 27, 2016
1 parent 183f354 commit da08c26
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
46 changes: 23 additions & 23 deletions packages/google-cloud-node/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ recognition technologies into developer applications.

* [Setup](#setup)
* [Samples](#samples)
* [Recognition](#recognition)
* [Recognize](#recognize)

## Setup

Expand All @@ -28,32 +28,32 @@ recognition technologies into developer applications.

## Samples

### Recognition
### Recognize

View the [documentation][recognition_docs] or the [source code][recognition_code].
View the [documentation][recognize_docs] or the [source code][recognize_code].

__Run the sample:__
__Usage:__ `node recognize --help`

Usage: `node recognize <path-to-audio-file>`
```
Commands:
sync <filename> Detects speech in an audio file.
async <filename> Creates a job to detect speech in an audio file, and waits for the job to complete.
stream <filename> Detects speech in an audio file by streaming it to the Speech API.
listen Detects speech in a microphone input stream.
Example:
Options:
--help Show help [boolean]
node recognize resources/audio.raw
Examples:
node recognize sync ./resources/audio.raw Detects speech in "./resources/audio.raw".
node recognize async ./resources/audio.raw Creates a job to detect speech in "./resources/audio.raw", and waits for
the job to complete.
node recognize stream ./resources/audio.raw Detects speech in "./resources/audio.raw" by streaming it to the Speech
API.
node recognize listen ./resources/audio.raw Detects speech in a microphone input stream.
[recognition_docs]: https://cloud.google.com/speech/
[recognition_code]: recognize.js
For more information, see https://cloud.google.com/speech/docs
```

### Recognition (Streaming)

View the [documentation][recognition_streaming_docs] or the [source code][recognition_streaming_code].

__Run the sample:__

Usage: `node recognize_streaming <path-to-audio-file>`

Example:

node recognize_streaming resources/audio.raw

[recognition_streaming_docs]: https://cloud.google.com/speech/
[recognition_streaming_code]: recognize_streaming.js
[recognize_docs]: https://cloud.google.com/speech/docs
[recognize_code]: recognize.js
13 changes: 7 additions & 6 deletions packages/google-cloud-node/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
"system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js"
},
"dependencies": {
"async": "^1.5.2",
"google-auto-auth": "^0.2.4",
"google-proto-files": "^0.3.0",
"googleapis": "^12.0.0",
"grpc": "^0.15.0"
"@google-cloud/speech": "^0.1.1",
"node-record-lpcm16": "^0.1.4",
"yargs": "^5.0.0"
},
"devDependencies": {
"mocha": "^2.5.3"
"mocha": "^3.0.2"
},
"engines": {
"node": ">=4.3.2"
}
}

0 comments on commit da08c26

Please sign in to comment.