//列出音源输出(到speaker、headset端)
# pacmd -h //帮助
 
# pacmd list-sinks //查看ports字段,就是外设通道
 
//切换扬声器通道
# pacmd set-sink-port 1 output-speaker
 
//切换听筒通道
# pacmd set-sink-port 1 output-earpiece
 
//切换耳机通道
# pacmd set-sink-port 1 output-wired——headphone
 
//切换HDMI的speaker
# pacmd set-sink-port 1 output-aux_digital
 
//播放wav
# paplay test.wav

 

//查看播放音频设备

#aplay –l

 

播放音频

aplay test.wav

//查看录音设备

arecord –l

//录音

arecord -Dhw:0,1 -d 10 -f cd -r 44100 -c 2 -t wav test.wav
参数解析
-D 指定了录音设备,0,1 是card 0 device 1的意思,也就是TDM_Capture
-d 指定录音的时长,单位时秒
-f 指定录音格式,通过上面的信息知道只支持 cd cdr dat
-r 指定了采样率,单位时Hz
-c 指定channel 个数
-t 指定生成的文件格式


 

 Pulseaudio

alsamixer

参考

https://wiki.archlinux.jp/index.php/PulseAudio/%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB

https://wiki.archlinux.org/index.php?title=PulseAudio/Examples&oldid=607753

https://www.jianshu.com/p/fc8c8cad67d6

相关文章:

  • 2021-05-06
  • 2021-12-18
  • 2021-06-22
  • 2021-06-26
  • 2022-12-23
  • 2022-03-10
  • 2021-05-27
  • 2021-09-05
猜你喜欢
  • 2021-11-30
  • 2021-09-23
  • 2021-09-26
  • 2021-04-19
  • 2022-01-04
  • 2022-12-23
  • 2021-08-25
相关资源
相似解决方案