File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -182,18 +182,19 @@ def listen_print_loop(recognize_stream):
182182
183183 # Display interim results, but with a carriage return at the end of the
184184 # line, so subsequent lines will overwrite them.
185- if not result . is_final :
186- # If the previous result was longer than this one, we need to print
187- # some extra spaces to overwrite the previous result
188- overwrite_chars = ' ' * max (0 , num_chars_printed - len (transcript ))
185+ #
186+ # If the previous result was longer than this one, we need to print
187+ # some extra spaces to overwrite the previous result
188+ overwrite_chars = ' ' * max (0 , num_chars_printed - len (transcript ))
189189
190+ if not result .is_final :
190191 sys .stdout .write (transcript + overwrite_chars + '\r ' )
191192 sys .stdout .flush ()
192193
193194 num_chars_printed = len (transcript )
194195
195196 else :
196- print (transcript )
197+ print (transcript + overwrite_chars )
197198
198199 # Exit recognition if any of the transcribed phrases could be
199200 # one of our keywords.
You can’t perform that action at this time.
0 commit comments