Skip to content

Commit e9ca302

Browse files
authored
Quickstart - print all results. (GoogleCloudPlatform#479)
1 parent 6fca8cf commit e9ca302

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

speech/quickstart.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ const request = {
5151

5252
// Detects speech in the audio file
5353
speechClient.recognize(request)
54-
.then((results) => {
55-
const transcription = results[0].results[0].alternatives[0].transcript;
54+
.then((data) => {
55+
const response = data[0];
56+
const transcription = response.results.map(result =>
57+
result.alternatives[0].transcript).join('\n');
5658
console.log(`Transcription: ${transcription}`);
5759
})
5860
.catch((err) => {

0 commit comments

Comments
 (0)