littlebutt / fubuki-iot

物联网IoT智能终端,支持Windows和树莓派
MIT License
6 stars 1 forks source link

尝试语音唤醒出错 #1

Open FrostN0v0 opened 1 year ago

FrostN0v0 commented 1 year ago

报错如下: `Traceback (most recent call last): File "/home/rasp/PycharmProjects/nonebot-plugin-iot/app.py", line 5, in Terminal.run() File "/home/rasp/PycharmProjects/nonebot-plugin-iot/venv/lib/python3.9/site-packages/iot/terminal.py", line 27, in run Pipeline.user_loop() File "/home/rasp/PycharmProjects/nonebot-plugin-iot/venv/lib/python3.9/site-packages/iot/pipeline.py", line 30, in user_loop if Context.recorder.awake(): File "/home/rasp/PycharmProjects/nonebot-plugin-iot/venv/lib/python3.9/site-packages/iot/core/hardware/recorder.py", line 42, in awake speech = LiveSpeech( File "/home/rasp/PycharmProjects/nonebot-plugin-iot/venv/lib/python3.9/site-packages/pocketsphinx/init.py", line 244, in init self.ad = sounddevice.RawInputStream( File "/home/rasp/PycharmProjects/nonebot-plugin-iot/venv/lib/python3.9/site-packages/sounddevice.py", line 1192, in init _StreamBase.init(self, kind='input', wrap_callback='buffer', File "/home/rasp/PycharmProjects/nonebot-plugin-iot/venv/lib/python3.9/site-packages/sounddevice.py", line 898, in init _check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters, File "/home/rasp/PycharmProjects/nonebot-plugin-iot/venv/lib/python3.9/site-packages/sounddevice.py", line 2747, in _check raise PortAudioError(errormsg, err) sounddevice.PortAudioError: Error opening RawInputStream: Invalid sample rate [PaErrorCode -9997]

进程已结束,退出代码1 ` 请问应该如何解决

littlebutt commented 1 year ago

根据提示是采样率有问题,这个请访问pocketsphinx官网查看相关的解决方案