gpt4 book ai didi

linux - aplay 无法从配置 .asoundrc 中读取

转载 作者:太空宇宙 更新时间:2023-11-04 12:15:15 25 4
gpt4 key购买 nike

我想让 aplay 从 .arecordrc 文件中读取,但它失败了。

pi@raspberrypi:~ $ aplay numnuts.wav 
ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card
aplay: main:722: audio open error: No such device

当我在命令行中提供硬件时它可以工作

pi@raspberrypi:~ $ aplay -D hw:0,0 numnuts.wav 
Playing WAVE 'numnuts.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

我的.asoundrc:

pi@raspberrypi:~ $ cat .asoundrc
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:1,0"
}
}
pcm.speaker {
type plug
slave {
pcm "hw:0:0"
}
}

谁能告诉我 pcm 中必须更改的内容。演讲者

aplay -l 输出

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0

最佳答案

解决了,是错别字:

在 pcm.speaker 中

replace pcm "hw:0:0"

pcm "hw:0,0"

关于linux - aplay 无法从配置 .asoundrc 中读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47605535/

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