我已经在树莓派上安装了 wip,但是当我想使用它时出现此错误
[wit] initialized sox: 14.4.0
[wit] init state machine
[wit] initialized with device: default
[wit] ready. state=idle
formats: can't open input `default': snd_pcm_open error: No such file or directory
[wit] couldn't open input device using alsa. Trying with coreaudio...
formats: no handler for given file type `coreaudio'
[wit] Failed to open input device
task '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value',
/home/martin/rust/src/libcore/option.rs:357
最佳答案
编辑 ~/.asoundrc
并添加以下内容:
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,0"
}
capture.pcm {
type plug
slave.pcm "hw:1,0"
}
}
(取自“设置默认记录设备”下的 http://wiki.audacityteam.org/wiki/USB_mic_on_Linux。)
要确定
slave.pcm
之后应该写什么,请运行以下命令:aplay -l
arecord -l
结果将分别指示
playback.pcm
和 capture.pcm
下应包含的内容。例如,
arecord -l
在我的机器上产生以下输出:**** List of CAPTURE Hardware Devices ****
card 1: USBSA [Andrea PureAudio USB-SA], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
slave.cpm
旁边的文本应为 "hw:X,Y"
,其中 X 和 Y 取自上述输出的第二行:card X: ..., device Y: ...
关于python - 树莓派 Python wit.ai 使用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28083153/