Getting IOError: [Errno Invalid number of channels] -9998 when using mic with PyAudio on Raspberry Pi
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Bad news, everyone! I try to use a microphone on my Raspberry Pi through PyAudio but without success. The microphone is connected to a USB sound card. The microphone works when I go through 'arecord' : pi@raspberrypi ~ $ arecord -D plughw:0,0 -f cd test2.wav Recording WAVE 'test2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo However, when I do the test record.py in PyAudio, I got an error. The error is the same for all programs in Python that uses PyAudio : pi@raspberrypi /usr/src/pyaudio/test $ python record.py ALSA lib pcm.c