aplay, arecord, amixer 用法
1.
aplay 就是撥音樂的
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: DVR [TI81XX DVR], device 0: SSM2602-PCM ssm2602-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: DVR [TI81XX DVR], device 1: hdmi HDMI-DAI-CODEC-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
aplay -D plughw:0,0 1.wav -v
plughw: card number, device number
2.
arecord 就是錄音的
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: DVR [TI81XX DVR], device 0: SSM2602-PCM ssm2602-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
arecord -D plughw:0,1 test.wav -v
plughw: card number, device number
可利用下面直接播出
arecord -Dhw:0,0 -r32000 -f cd|aplay -Dhw:0,0 -r32000
3.
amixer 調整音量和參數用的
amixer -h 可以看到比較詳細的介紹
amixer controls
numid=2,iface=MIXER,name='Master Playback ZC Switch'
numid=1,iface=MIXER,name='Master Playback Volume'
numid=5,iface=MIXER,name='Mic Boost (+20dB)'
numid=6,iface=MIXER,name='Mic Boost2 (+20dB)'
numid=7,iface=MIXER,name='Mic Switch'
numid=9,iface=MIXER,name='ADC High Pass Filter Switch'
numid=11,iface=MIXER,name='Capture Source'
numid=4,iface=MIXER,name='Capture Switch'
numid=3,iface=MIXER,name='Capture Volume'
numid=12,iface=MIXER,name='Playback De-emphasis'
numid=13,iface=MIXER,name='Input Mux'
numid=16,iface=MIXER,name='Output Mixer HiFi Playback Switch'
numid=14,iface=MIXER,name='Output Mixer Line Bypass Switch'
numid=15,iface=MIXER,name='Output Mixer Mic Sidetone Switch'
numid=8,iface=MIXER,name='Sidetone Playback Volume'
numid=10,iface=MIXER,name='Store DC Offset Switch'
每個 id 代表 audio codec 的每個元件, 詳細請看 ALSA 的介紹.
amixer cget numid=1
numid=1,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw------,values=2,min=0,max=127,step=0
: values=121,121
表示 playback 的音量
amixer cset numid=1 80% 80%
numid=1,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw------,values=2,min=0,max=127,step=0
: values=102,102
設定 playback 的音量, 可用百分比或數字代表.
直接用 amixer 則可以看到所有的元件和設定值
aplay 就是撥音樂的
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: DVR [TI81XX DVR], device 0: SSM2602-PCM ssm2602-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: DVR [TI81XX DVR], device 1: hdmi HDMI-DAI-CODEC-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
aplay -D plughw:0,0 1.wav -v
plughw: card number, device number
2.
arecord 就是錄音的
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: DVR [TI81XX DVR], device 0: SSM2602-PCM ssm2602-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
arecord -D plughw:0,1 test.wav -v
plughw: card number, device number
可利用下面直接播出
arecord -Dhw:0,0 -r32000 -f cd|aplay -Dhw:0,0 -r32000
3.
amixer 調整音量和參數用的
amixer -h 可以看到比較詳細的介紹
amixer controls
numid=2,iface=MIXER,name='Master Playback ZC Switch'
numid=1,iface=MIXER,name='Master Playback Volume'
numid=5,iface=MIXER,name='Mic Boost (+20dB)'
numid=6,iface=MIXER,name='Mic Boost2 (+20dB)'
numid=7,iface=MIXER,name='Mic Switch'
numid=9,iface=MIXER,name='ADC High Pass Filter Switch'
numid=11,iface=MIXER,name='Capture Source'
numid=4,iface=MIXER,name='Capture Switch'
numid=3,iface=MIXER,name='Capture Volume'
numid=12,iface=MIXER,name='Playback De-emphasis'
numid=13,iface=MIXER,name='Input Mux'
numid=16,iface=MIXER,name='Output Mixer HiFi Playback Switch'
numid=14,iface=MIXER,name='Output Mixer Line Bypass Switch'
numid=15,iface=MIXER,name='Output Mixer Mic Sidetone Switch'
numid=8,iface=MIXER,name='Sidetone Playback Volume'
numid=10,iface=MIXER,name='Store DC Offset Switch'
每個 id 代表 audio codec 的每個元件, 詳細請看 ALSA 的介紹.
amixer cget numid=1
numid=1,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw------,values=2,min=0,max=127,step=0
: values=121,121
表示 playback 的音量
amixer cset numid=1 80% 80%
numid=1,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw------,values=2,min=0,max=127,step=0
: values=102,102
設定 playback 的音量, 可用百分比或數字代表.
直接用 amixer 則可以看到所有的元件和設定值
留言
張貼留言