Pass threshold as arg

master
jan 5 years ago
parent db4d23a6d9
commit a93bfa3d4d

@ -161,6 +161,7 @@ class AudioAnalyzer:
def monitor_pitch(pyaudio_device: int,
min_freq: float = 10,
max_freq: float = 6000,
threshold: float = 1e6,
):
analyzer = AudioAnalyzer(pyaudio_device=pyaudio_device,
@ -173,7 +174,7 @@ def monitor_pitch(pyaudio_device: int,
while True:
frame_data = analyzer.frame_queue.get()
if frame_data['magnitude'] <= 10**6:
if frame_data['magnitude'] <= threshold:
continue
prev_magnitude = frame_data['magnitude']

Loading…
Cancel
Save