Skip to content

Commit

Permalink
Update Speech samples. (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry authored Nov 21, 2016
1 parent efb9552 commit 9b3ed47
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 70 deletions.
14 changes: 6 additions & 8 deletions packages/google-cloud-speech/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ recognition technologies into developer applications.

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

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

```
Commands:
Expand All @@ -42,15 +42,13 @@ Commands:
listen Detects speech in a microphone input stream.
Options:
--help Show help [boolean]
--help Show help [boolean]
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.
node recognize.js sync ./resources/audio.raw
node recognize.js async ./resources/audio.raw
node recognize.js stream ./resources/audio.raw
node recognize.js listen
For more information, see https://cloud.google.com/speech/docs
```
Expand Down
6 changes: 1 addition & 5 deletions packages/google-cloud-speech/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
"license": "Apache Version 2.0",
"author": "Google Inc.",
"scripts": {
"test": "mocha -R spec -t 10000 --require intelli-espower-loader ../test/_setup.js test/*.test.js",
"system-test": "mocha -R spec -t 10000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js"
"test": "cd ..; npm run st -- speech/system-test/*.test.js"
},
"dependencies": {
"@google-cloud/speech": "^0.4.0",
"node-record-lpcm16": "^0.1.4",
"yargs": "^6.4.0"
},
"devDependencies": {
"mocha": "^3.1.2"
},
"engines": {
"node": ">=4.3.2"
}
Expand Down
13 changes: 5 additions & 8 deletions packages/google-cloud-speech/samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ const options = {
};

// Detects speech in the audio file
speechClient.recognize(fileName, options, (err, result) => {
if (err) {
console.error(err);
return;
}

console.log(`Transcription: ${result}`);
});
speechClient.recognize(fileName, options)
.then((results) => {
const transcription = results[0];
console.log(`Transcription: ${transcription}`);
});
// [END speech_quickstart]
49 changes: 0 additions & 49 deletions packages/google-cloud-speech/samples/test/quickstart.test.js

This file was deleted.

0 comments on commit 9b3ed47

Please sign in to comment.