Skip to content

Commit

Permalink
Quickstart - print all results. (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerjou authored Sep 12, 2017
1 parent 19cf390 commit 33d5ba8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions speech/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ const request = {

// Detects speech in the audio file
speechClient.recognize(request)
.then((results) => {
const transcription = results[0].results[0].alternatives[0].transcript;
.then((data) => {
const response = data[0];
const transcription = response.results.map(result =>
result.alternatives[0].transcript).join('\n');
console.log(`Transcription: ${transcription}`);
})
.catch((err) => {
Expand Down

0 comments on commit 33d5ba8

Please sign in to comment.