Skip to content

Commit

Permalink
Fixes #348
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Apr 12, 2017
1 parent 638c19e commit 6d46b94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion speech/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Options:
Examples:
node recognize.js sync ./resources/audio.raw -e LINEAR16 -r 16000
node recognize.js async-gcs gs://my-bucket/audio.raw -e LINEAR16 -r 16000
node recognize.js async-gcs gs://gcs-test-data/vr.flac -e FLAC -r 16000
node recognize.js stream ./resources/audio.raw -e LINEAR16 -r 16000
node recognize.js listen
Expand Down
8 changes: 5 additions & 3 deletions speech/recognize.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ function asyncRecognize (filename, encoding, sampleRateHertz, languageCode) {
// Get a Promise represention of the final result of the job
return operation.promise();
})
.then((transcription) => {
.then((results) => {
const transcription = results[0];
console.log(`Transcription: ${transcription}`);
})
.catch((err) => {
Expand Down Expand Up @@ -178,7 +179,8 @@ function asyncRecognizeGCS (gcsUri, encoding, sampleRateHertz, languageCode) {
// Get a Promise represention of the final result of the job
return operation.promise();
})
.then((transcription) => {
.then((results) => {
const transcription = results[0];
console.log(`Transcription: ${transcription}`);
})
.catch((err) => {
Expand Down Expand Up @@ -333,7 +335,7 @@ require(`yargs`)
}
})
.example(`node $0 sync ./resources/audio.raw -e LINEAR16 -r 16000`)
.example(`node $0 async-gcs gs://my-bucket/audio.raw -e LINEAR16 -r 16000`)
.example(`node $0 async-gcs gs://gcs-test-data/vr.flac -e FLAC -r 16000`)
.example(`node $0 stream ./resources/audio.raw -e LINEAR16 -r 16000`)
.example(`node $0 listen`)
.wrap(120)
Expand Down

0 comments on commit 6d46b94

Please sign in to comment.