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 b6adab5 commit 586ca0f
Showing 1 changed file with 5 additions and 3 deletions.
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 586ca0f

Please sign in to comment.