nickbild / voice_chatgpt

VoiceGPT is a voice assistant that leverages the powerful ChatGPT chatbot to answer your questions.
Other
318 stars 65 forks source link

Issues with sound card ? #1

Open PabloCarco opened 1 year ago

PabloCarco commented 1 year ago

when i run the script i get the following error: Traceback (most recent call last): File "/home/pi/Documents/voice_chat.py", line 164, in <module> main() File "/home/pi/Documents/voice_chat.py", line 146, in main record_wav() File "/home/pi/Documents/voice_chat.py", line 105, in record_wav stream = audio.open(format = form_1,rate = samp_rate,channels = chans, \ File "/home/pi/.local/lib/python3.9/site-packages/pyaudio/__init__.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) File "/home/pi/.local/lib/python3.9/site-packages/pyaudio/__init__.py", line 441, in __init__ self._stream = pa.open(**arguments) OSError: [Errno -9998] Invalid number of channels

it seems to me that pyaudio is installed correctly, maybe something with the configuration of the sound card? I'm using an external usb card with a microphone

erichilario commented 1 year ago
$ arecord -l

**** List of CAPTURE Hardware Devices ****
card 2: rockchipes8388 [rockchip-es8388], device 0: dailink-multicodecs ES8323.6-0010-0 [dailink-multicodecs ES8323.6-0010-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

i changed line 98 from dev_index = 1 to dev_index = 2

braveashu commented 1 year ago

when i run the script i get the following error: Traceback (most recent call last): File "/home/pi/Documents/voice_chat.py", line 164, in <module> main() File "/home/pi/Documents/voice_chat.py", line 146, in main record_wav() File "/home/pi/Documents/voice_chat.py", line 105, in record_wav stream = audio.open(format = form_1,rate = samp_rate,channels = chans, \ File "/home/pi/.local/lib/python3.9/site-packages/pyaudio/__init__.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) File "/home/pi/.local/lib/python3.9/site-packages/pyaudio/__init__.py", line 441, in __init__ self._stream = pa.open(**arguments) OSError: [Errno -9998] Invalid number of channels

it seems to me that pyaudio is installed correctly, maybe something with the configuration of the sound card? I'm using an external usb card with a microphone

Is your issue got resolved?