After a pacman -Syu on January 8th I am now able to record at 16K with alsa.
arecord -f dat -r 16000
However accessing the microphone at 16K through python still fails. Using the speech_recognition library, I create a Microphone and a Recognizer.
import speech_recognition as sr
mic = sr.Microphone()
r = sr.Recognizer()
with mic as source:
audio = r.listen(source)
When listening to the Microphone with the Recognizer I get the following:
Expression 'alsa_snd_pcm_poll_descriptors_revents(...params...)' failed in src/hostapi/alsa/pa_linux_alsa.c, line: 3654
Expression 'PaAlsaStreamComponent_EndPolling(...params...)' failed in src/hostapi/alsa/pa_linux_alsa.c, line: 3871
Expression 'PaAlsaStream_WaitForFrames(...params...)' failed in src/hostapi/alsa/pa_linux_alsa.c, line: 4418
This happens in site-packages/speech_recognition/__init__.py line 161 in read() and line 652 in Recognizer.listen()
buffer = source.stream.read(source, CHUNK)
and the actual python line which fails is in site-packages/pyaudio.py line 608
pa.read_stream(...params...)
At this point I think the Microphone is not being initialized properly from pyaudio, Endianness perhaps?
Any nuggets of wisdom will be greatly appreciated
LF