diff --git a/play.py b/play.py index 6ab2ab8..340ff14 100644 --- a/play.py +++ b/play.py @@ -288,10 +288,10 @@ def play_audio(buf, sample_rate, title="", info_lines=None, offset_sec=0.0): if info_lines: for line in info_lines: print(f" {line}") - print() + print() # scope line + print() # blank print(" [+/f] +5s [-/s] -5s [d] +30s [a] -30s [space] pause [n] next [p] prev [q] quit") - print() - print() # scope line + progress line + print() # progress line stream = sd.OutputStream( samplerate=sample_rate, @@ -363,7 +363,8 @@ 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[2A\r {scope} \r\n\n\r {icon} {cur_m}:{cur_s:02d} / {tot_m}:{tot_s:02d} {bar} ") + # Draw: move up 3 lines, write scope, skip controls line, write progress + sys.stderr.write(f"\033[3A\r {scope} \r\n\n\n\r {icon} {cur_m}:{cur_s:02d} / {tot_m}:{tot_s:02d} {bar} ") sys.stderr.flush() # Non-blocking single char read