-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (22 loc) · 727 Bytes
/
Copy pathapp.py
File metadata and controls
31 lines (22 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import logging
from sys import argv
from PyQt5.QtWidgets import QApplication
from monitor.mics import choose_microphone
from monitor.visualizer import SoundCaptureVisualizer
logging.basicConfig(format="%(levelname)s - %(message)s", level=logging.INFO)
def main():
microphone = choose_microphone()
app = QApplication(argv)
visualizer = SoundCaptureVisualizer(microphone)
try:
visualizer.show()
visualizer.update()
app.exec_()
except (ValueError, TypeError) as e:
visualizer.close_sound_streaming()
logging.error(e + " - Application level error")
finally:
logging.info("Application is closed")
del app
if __name__ == "__main__":
main()