英特尔爱迪生语音控制 - 如何配置 alsa

英特尔爱迪生语音控制 - 如何配置 alsa

我想使用 Intel Edison 实现语音控制轮椅。基本上,我会通过连接到 Edison 开发板的麦克风说出前进、左转、右转和停止。声音适配器

对于初始原型,我只想将语音识别的输出显示到 CLI。

我正在关注在线教程。一切都很好,直到声音配置部分。

接下来是本教程中使用的命令的 CLI 输出。

lsusb:

root@edison:/home/speech_to_text# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

alsa-实用程序:

root@edison:/home/speech_to_text# opkg install alsa-utils libportaudio2 libasound2 bison espeak alsa-lib-dev alsa-utils-dev alsa-dev python-numpy
Package alsa-utils (1.0.28-r0) installed in root is up to date.
Package libportaudio2 (v19+svnr1387-r0) installed in root is up to date.
Package libasound2 (1.0.28-r0) installed in root is up to date.
Package bison (2.7.1-r0) installed in root is up to date.
Package espeak (1.48.04-r0) installed in root is up to date.
Package alsa-lib-dev (1.0.28-r0) installed in root is up to date.
Package alsa-utils-dev (1.0.28-r0) installed in root is up to date.
Package alsa-lib-dev (1.0.28-r0) installed in root is up to date.
Package python-numpy (1.7.0-r1) installed in root is up to date.

aplay:(此处出现错误)

root@edison:/home/speech_to_text# aplay -Ll
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing configuration
**** List of PLAYBACK Hardware Devices ****
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing configuration
aplay: device_list:277: control open (0): Invalid argument
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing configuration
aplay: device_list:277: control open (1): Invalid argument
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing confroot@elab_iot_edison:/home/speech_to_text# installPip.sh

我应该怎样修复此问题?

答案1

好的,解决了。.asoundrc 文件出了点​​问题。

将 .asoundrc 的内容替换为以下内容,它就起作用了。链接来解决它。

pcm.!default {
    type hw
    card 0
}

ctl.!default {
    type hw           
    card 0
}

相关内容