gpt4 book ai didi

python - 树莓派 Python wit.ai 使用

转载 作者:太空宇宙 更新时间:2023-11-03 15:09:59 26 4
gpt4 key购买 nike

我已经在我的树莓派上安装了 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"
}
}

This little ALSA configuration setting uses the default soundcard as playback device (hw:0,0) and sets hw:1,0 (that suppose to be your USB-mic) to become the default capture device.

(摘自“设置默认录音设备”下的 http://wiki.audacityteam.org/wiki/USB_mic_on_Linux。)

要确定在 slave.pcm 之后应该写什么,运行以下命令:

aplay -l
arecord -l

结果将分别指示 playback.pcmcapture.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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com