Skip to content

Commit 1ca9a80

Browse files
authored
Update visualizer.py - Cleaned message and terminal issue.
Line 76 for info
1 parent fa23211 commit 1ca9a80

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

audio_visualizer/visualizer.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
visualize_horizontal_left_to_right)
1515
from audio_visualizer.horizontal_right_to_left_visualizer import (
1616
visualize_horizontal_right_to_left)
17-
17+
import os
1818

1919
class AudioVisualizer:
2020
"""Audio Visualizer for terminal.
@@ -74,7 +74,13 @@ def start(self):
7474
self.bar_count, self.window,
7575
self.smoothed_fft)
7676
except KeyboardInterrupt:
77-
logging.info("Visualization stopped by user.")
77+
# Terminal cleared using cls/ clear. Print statement processed after clearing terminal.
78+
if os.name == 'nt':
79+
os.system('cls')
80+
print('Visualization stopped by user.')
81+
else:
82+
os.system('clear')
83+
print('Visualization stopped by user.')
7884
except Exception as e:
7985
logging.error(f"An error occurred: {e}")
8086
finally:

0 commit comments

Comments
 (0)