set default index to 1 for macos

This commit is contained in:
William Enemali 2023-05-31 06:43:06 -04:00
parent 08e76a3453
commit 3d13c82038
2 changed files with 4 additions and 1 deletions

View File

@ -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"],

View File

@ -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
</details>
### 🔧 Installation