python-docs-samples
python-docs-samples copied to clipboard
Bug in transcribe_streaming_infinite.py sample code
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:
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: