File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ create an instance of :class:`~google.cloud.speech.client.Client`.
3131 >> > client = speech.Client()
3232
3333
34- Asychronous Recognition
35- -----------------------
34+ Asynchronous Recognition
35+ ------------------------
3636
3737The :meth: `~google.cloud.speech.Client.async_recognize ` sends audio data to the
3838Speech API and initiates a Long Running Operation. Using this operation, you
@@ -170,13 +170,13 @@ speech data to possible text alternatives on the fly.
170170 ... for result in results:
171171 ... for alternative in result.alternatives:
172172 ... print (' =' * 20 )
173+ ... print (' result_index: ' + str (result.result_index))
173174 ... print (' transcript: ' + alternative.transcript)
174175 ... print (' confidence: ' + str (alternative.confidence))
175176 ====================
176177 transcript: hello thank you for using Google Cloud platform
177178 confidence: 0.927983105183
178179
179-
180180By default the API will perform continuous recognition
181181(continuing to process audio even if the speaker in the audio pauses speaking)
182182until the client closes the output stream or until the maximum time limit has
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ def test_stream_recognize(self):
200200
201201 with open (AUDIO_FILE , 'rb' ) as file_obj :
202202 for results in self ._make_streaming_request (file_obj ):
203+ self .assertIsInstance (results .result_index , int )
203204 self ._check_results (results .alternatives )
204205
205206 def test_stream_recognize_interim_results (self ):
You can’t perform that action at this time.
0 commit comments