I’m in the process of trying to set up Rhasspy, and I’ve run into a problem when I train it on my profile:
Traceback (most recent call last):
File “/usr/share/rhasspy/rhasspy/audio_recorder.py”, line 170, in to_recording
File “/usr/share/rhasspy/.venv/lib/python3.7/site-packages/pyaudio.py”, line 750, in open
stream = Stream(self, *args, **kwargs)
File “/usr/share/rhasspy/.venv/lib/python3.7/site-packages/pyaudio.py”, line 441, in init
self._stream = pa.open(**arguments)
OSError: [Errno -9997] Invalid sample rate
My environment is:
- Raspberry Pi 4B, running Raspbian Buster
- Installed into Docker
- Python 3.7.3
- Porcupine wake handling
I assume this error springs from PyAudio or ALSA. When I originally encountered the same error message, earlier in the setup, I edited my .asoundrc and alsa.conf files, and that all seemed fine, the error went away. After that, I was able to get pvporcupine_mic and the Python SpeechRecognition commands to work ok. Everything seemed fine until I tried the training, when the error returned.
This is my currnent profile:
My best guess is that editing the .asoundrc and alsa.conf files doesn’t mean the new settings are available to Rhasspy, inside its Docker environment.
I can provide more diagnostics if there’s anything useful I’ve missed. I’ll stress that for much of the setup process, I’ve simply tried to follow the online instructions by rote, as there’s much I’m unfamiliar with, so please bear with me if I’ve missed something obvious, or if I don’t immediately grasp the technicalities of a response here.