diff --git a/play.py b/play.py index a437826..f06b314 100644 --- a/play.py +++ b/play.py @@ -291,9 +291,7 @@ def play_audio(buf, sample_rate, title="", info_lines=None, offset_sec=0.0): print() print(" [+/f] +5s [-/s] -5s [d] +30s [a] -30s [space] pause [n] next [p] prev [q] quit") print() - print() # blank lines for oscilloscope + whitespace + progress - print() - print() + print() # scope line + progress line stream = sd.OutputStream( samplerate=sample_rate, @@ -363,8 +361,7 @@ def play_audio(buf, sample_rate, title="", info_lines=None, offset_sec=0.0): else: scope = "\033[90m" + "─" * scope_w + "\033[0m" - sys.stderr.write(f"\033[3A\r\n {scope}\n\n") - sys.stderr.write(f"\r {icon} {cur_m}:{cur_s:02d} / {tot_m}:{tot_s:02d} {bar} \n") + sys.stderr.write(f"\033[2A\r {scope} \r\n\n\r {icon} {cur_m}:{cur_s:02d} / {tot_m}:{tot_s:02d} {bar} ") sys.stderr.flush() # Non-blocking single char read