From 586ca0f99e4317847bac807d3d3432eed7accf2f Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 12 Apr 2017 16:24:40 -0700 Subject: [PATCH] Fixes #348 --- speech/recognize.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/speech/recognize.js b/speech/recognize.js index 81c9bad1712..6566079f0e3 100644 --- a/speech/recognize.js +++ b/speech/recognize.js @@ -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) => { @@ -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) => { @@ -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)