This error is cause by an unsupported sampling rate being set to your usb sound card.
You will have to do some research and/or test common sampling rates to see which are supported by that specific sound card.
The sample rate is set on line 81 in Andy's original code and default is 16,000Hz (16kHz)
Thank you! I got it working using 48,000Hz. That fixed that issue, now I am getting this:
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_oss.c:377: (_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377: (_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823: (_snd_pcm_a52_open) a52 is only for playback
ALSA lib pcm_usb_stream.c:486: (_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486: (_snd_pcm_usb_stream_open) Invalid type for card
{'command': 'on_channel_status', 'channel': ' - deleted - ', 'status': 'online', 'users_online': 2, 'images_supported': True, 'texting_supported': True, 'locations_supported': True}
{'stream_id': - deleted -, 'success': True, 'seq': 2}
sending to stream_id - deleted -
Traceback (most recent call last):
File "zellostream.py", line 180, in <module>
data = record(.06)
File "zellostream.py", line 93, in record
data = stream.read(chunk)
File "/home/pi/.local/lib/python3.7/site-packages/pyaudio.py", line 608, in read
return pa.read_stream(self._stream, num_frames, exception_on_overflow)
OSError: [Errno -9981] Input overflowed
Anyone know what causes "Input overflowed" and how to fix it? Thanks!