Previous behavior only slept when there was audio in the buffer.
This caused two issues, it meant that quarter of a second pauses interrupted each time step, making the phrase timeout slightly inaccurate and most importantly, it meant that the infinite loop wasn't being slept whenever there wasn't data in the queue, which makes it keep running with no pause
This commit is contained in:
parent
828dd92044
commit
5db3b0f7b1
@ -128,7 +128,7 @@ def main():
|
|||||||
print(line)
|
print(line)
|
||||||
# Flush stdout.
|
# Flush stdout.
|
||||||
print('', end='', flush=True)
|
print('', end='', flush=True)
|
||||||
|
else:
|
||||||
# Infinite loops are bad for processors, must sleep.
|
# Infinite loops are bad for processors, must sleep.
|
||||||
sleep(0.25)
|
sleep(0.25)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
Loading…
Reference in New Issue
Block a user