如何查看音频设备
如果你的系统有 /proc/asound/cards 路径,说明 ALSA 驱动已经使用上,可查看 sound devices:
cat /proc/asound/cards 0 [Intel ]: HDA-Intel - HDA Intel HDA Intel at 0xf2520000 irq 17 复制
也可以用 arecord 和 aplay 工具.其中 arecord 查看 microphone (capture or input device):
$ arecord -l **** List of CAPTURE Hardware Devices **** card 0: Intel [HDA Intel], device 0: HDA Generic [HDA Generic] Subdevices: 1/1 Subdevice #0: subdevice #0 复制
aplay 查看 speaker (output device) :
$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: Intel [HDA Intel], device 0: HDA Generic [HDA Generic] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: Intel [HDA Intel], device 3: INTEL HDMI [INTEL HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 复制
使用 arecord 测试 microphone
运行下面命令,录音 10 秒:
$ arecord -d 10 /tmp/t.wav 复制
播放 arecord 的录音
$ aplay /tmp/t.wav复制