Skip to content

how to access streaming recognize using while loop #2405

@ningwudm00

Description

@ningwudm00

In which file did you encounter the issue?

used google example on how to transcribe streaming audio

Did you change the file? If so, how?

Describe the issue

Need help on how to access stream recognize results in while loop. the code below works fine:

responses = client.streaming_recognize(streaming_config, requests)
for response in responses:
result = response.results[0]

but when i try to access the same data using while loop, it shows "'_StreamingResponseIterator' object is not subscriptable". can someone help me how to resolve this issue? I need to use while loop to show GUI update. Thanks a lot!

rr=0
while True:
response=responses[rr]
result = response.results[0]
rr+=1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions