Record sound
#8
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
  Reply


Messages In This Thread
Record sound - by Veraendert - 12-29-2020, 01:11 AM
RE: Record sound - by defactofactotum - 12-29-2020, 04:00 AM
RE: Record sound - by Lousy Fisherman - 12-29-2020, 12:37 PM
RE: Record sound - by Lousy Fisherman - 12-29-2020, 04:15 PM
RE: Record sound - by Veraendert - 12-30-2020, 12:54 AM
RE: Record sound - by Lousy Fisherman - 12-30-2020, 11:32 AM
RE: Record sound - by Veraendert - 12-30-2020, 12:42 PM
RE: Record sound - by Lousy Fisherman - 01-09-2021, 12:21 PM
RE: Record sound - by Lousy Fisherman - 01-09-2021, 06:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Phone calls with no sound user641 14 6,887 03-12-2023, 11:43 AM
Last Post: alpineduck

Forum Jump:


Users browsing this thread: 1 Guest(s)