ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) 卡 arecord 的值无效:main:722:音频打开错误:没有那个文件或目录 [英] ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card arecord: main:722: audio open error: No such file or directory

查看:80
本文介绍了ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) 卡 arecord 的值无效:main:722:音频打开错误:没有那个文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究语音识别.为此,我正在使用alsa-utils",但是当我尝试使用此脚本时

i am working on speech recognition . for this i am using "alsa-utils" but when i try to use this script

    #!/bin/bash

echo "Recording… Press Ctrl+C to Stop."
arecord -D plughw:1,0 -q -f cd -t wav | ffmpeg -loglevel panic -y -i – -ar 16000 -acodec flac file.flac > /dev/null 2>&1

echo "Processing…"
wget -q -U "Mozilla/5.0" –post-file file.flac –header "Content-Type: audio/x-flac; rate=16000" -O – "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" | cut -d" -f12 >stt.txt

echo -n "You Said: "
cat stt.txt

rm file.flac > /dev/null 2>&1

我收到此错误

    "Recording… Press Ctrl+C to Stop."
ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card
arecord: main:722: audio open error: No such file or directory
"Processing…"

请帮忙:(

推荐答案

从 pastebin 我看到 card 0 然后 device 0device 1,因此请尝试将 arecord 命令与 card,device 以这样的顺序排列,

From the pastebin I see card 0 then device 0 or device 1, so try lining up the arecord command with card,device in that order like one of these,

arecord -D plughw:0,0 -q -f cd -t wav | ...
arecord -D plughw:0,1 -q -f cd -t wav | ...

这篇关于ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) 卡 arecord 的值无效:main:722:音频打开错误:没有那个文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆