From 545f13235b892eec8f52ade3ed607f5be4f58eb2 Mon Sep 17 00:00:00 2001 From: Jerjou Date: Tue, 12 Sep 2017 15:17:32 -0700 Subject: [PATCH] quickstart: print out all results. [(#1108)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1108) --- speech/snippets/quickstart.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/speech/snippets/quickstart.py b/speech/snippets/quickstart.py index 388e7ffc55aa..db93b3fc4d57 100644 --- a/speech/snippets/quickstart.py +++ b/speech/snippets/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]