Skip to content

Commit ae66917

Browse files
jerjoubusunkim96
authored andcommitted
quickstart: print out all results. [(#1108)](GoogleCloudPlatform/python-docs-samples#1108)
1 parent e5f3a9d commit ae66917

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/google-cloud-speech/samples/snippets/quickstart.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ def run_quickstart():
5050

5151
# Detects speech in the audio file
5252
response = client.recognize(config, audio)
53-
alternatives = response.results[0].alternatives
5453

55-
for alternative in alternatives:
56-
print('Transcript: {}'.format(alternative.transcript))
54+
for result in response.results:
55+
print('Transcript: {}'.format(result.alternatives[0].transcript))
5756
# [END speech_quickstart]
5857

5958

0 commit comments

Comments
 (0)