File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
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
@@ -169,6 +169,8 @@ speech data to possible text alternatives on the fly.
169169 ... encoding = speech.Encoding.LINEAR16 ,
170170 ... sample_rate = 16000 )
171171 ... results = list (sample.streaming_recognize())
172+ >> > print (results[0 ].result_index)
173+ 0
172174 >> > print (results[0 ].alternatives[0 ].transcript)
173175 ' hello'
174176 >> > print (results[0 ].alternatives[0 ].confidence)
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