|
|
|
@ -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']
|
|
|
|
|