Skip to content

Commit 6d46b94

Browse files
committed
Fixes #348
1 parent 638c19e commit 6d46b94

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

speech/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Options:
5050
5151
Examples:
5252
node recognize.js sync ./resources/audio.raw -e LINEAR16 -r 16000
53-
node recognize.js async-gcs gs://my-bucket/audio.raw -e LINEAR16 -r 16000
53+
node recognize.js async-gcs gs://gcs-test-data/vr.flac -e FLAC -r 16000
5454
node recognize.js stream ./resources/audio.raw -e LINEAR16 -r 16000
5555
node recognize.js listen
5656

speech/recognize.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ function asyncRecognize (filename, encoding, sampleRateHertz, languageCode) {
135135
// Get a Promise represention of the final result of the job
136136
return operation.promise();
137137
})
138-
.then((transcription) => {
138+
.then((results) => {
139+
const transcription = results[0];
139140
console.log(`Transcription: ${transcription}`);
140141
})
141142
.catch((err) => {
@@ -178,7 +179,8 @@ function asyncRecognizeGCS (gcsUri, encoding, sampleRateHertz, languageCode) {
178179
// Get a Promise represention of the final result of the job
179180
return operation.promise();
180181
})
181-
.then((transcription) => {
182+
.then((results) => {
183+
const transcription = results[0];
182184
console.log(`Transcription: ${transcription}`);
183185
})
184186
.catch((err) => {
@@ -333,7 +335,7 @@ require(`yargs`)
333335
}
334336
})
335337
.example(`node $0 sync ./resources/audio.raw -e LINEAR16 -r 16000`)
336-
.example(`node $0 async-gcs gs://my-bucket/audio.raw -e LINEAR16 -r 16000`)
338+
.example(`node $0 async-gcs gs://gcs-test-data/vr.flac -e FLAC -r 16000`)
337339
.example(`node $0 stream ./resources/audio.raw -e LINEAR16 -r 16000`)
338340
.example(`node $0 listen`)
339341
.wrap(120)

0 commit comments

Comments
 (0)