python-docs-samples icon indicating copy to clipboard operation
python-docs-samples copied to clipboard

Bug in transcribe_streaming_infinite.py sample code

Open egrabs opened this issue 1 year ago • 0 comments

In which file did you encounter the issue?

speech/microphone/transcribe_streaming_infinite.py

Did you change the file? If so, how?

Yes. Remove this return

Describe the issue

The script does not properly overwrite interim results:

Screenshot 2024-04-18 at 9 12 08 AM

This is because of the return statement at the bottom of the for loop over the response generator in listen_print_loop here

Removing this return statement and allowing the loop to keep iterating the generator until the break statement is encountered allows for properly overwriting interim results:

Screenshot 2024-04-18 at 9 15 17 AM

egrabs avatar Apr 18 '24 14:04 egrabs