From 84f71c8614a03911f43b385eb2bd86d5812e53ba Mon Sep 17 00:00:00 2001 From: Jerjou Cheng Date: Tue, 12 Sep 2017 14:56:11 -0700 Subject: [PATCH] quickstart: print out all results. --- speech/cloud-client/quickstart.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/speech/cloud-client/quickstart.py b/speech/cloud-client/quickstart.py index 388e7ffc55a..db93b3fc4d5 100644 --- a/speech/cloud-client/quickstart.py +++ b/speech/cloud-client/quickstart.py @@ -50,10 +50,9 @@ def run_quickstart(): # Detects speech in the audio file response = client.recognize(config, audio) - alternatives = response.results[0].alternatives - for alternative in alternatives: - print('Transcript: {}'.format(alternative.transcript)) + for result in response.results: + print('Transcript: {}'.format(result.alternatives[0].transcript)) # [END speech_quickstart]