aplay -D plughw:0,0 xxx.wav
plughw后面的0,0指的是card0,device0.(声卡id和设备id),根据个人情况会有不同
声卡id和设备id可以通过aplay -l命令来查看
比如:
upsquared@ubuntu:~/work18.7.12$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
从上面可以看出我的audio设备是最后一个:
card 2: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
声卡id为2(因为是card2),设备id为0,所以aplay -D plughw:2,0 xxx.wav 即可。