From 3d13c82038d3cddbde978af16b78ecf13e6ac799 Mon Sep 17 00:00:00 2001 From: William Enemali Date: Wed, 31 May 2023 06:43:06 -0400 Subject: [PATCH] set default index to 1 for macos --- AudioRecorder.py | 2 +- README.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AudioRecorder.py b/AudioRecorder.py index c653f16..5a5e4a8 100644 --- a/AudioRecorder.py +++ b/AudioRecorder.py @@ -52,7 +52,7 @@ class DefaultSpeakerRecorder(BaseRecorder): print("[ERROR] No loopback device found.") else: p = pyaudio.PyAudio() - default_speakers = p.get_device_info_by_index(0) + default_speakers = p.get_device_info_by_index(1) source = sr.Microphone(speaker=True, device_index= default_speakers["index"], diff --git a/README.md b/README.md index 88112a9..9b40977 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ If FFmpeg is not installed in your system, you can follow the steps below to ins brew install portaudio brew install python-tk + You might need to change the index of your speaker depending on your setting to 0 or 1 + on line 55 AudioRecorder.py + ### 🔧 Installation