安装声音服务
sudo apt-get install alsa-utils
加载驱动
sudo modprobe snd_bcm2835
编译DEMO
cd /opt/vc/src/hello_pi/
./rebuild.sh
测试DEMO
cd hello_audio
3.5毫米输出
./hello_audio.bin
HDMI输出
./hello_audio.bin 1
=============================================================
命令行播放器:
sudo apt-get install mplayer
GUI播放器:
sudo apt-get install smplayer
播放MP3
mplayer -ao alsa test.mp3
=============================================================
调节音量
GUI模式
alsamixer
命令行模式
amixer
amixer sset PCM 80%
amixer --help
Usage: amixer [command]
Available options:
-h,--help this help
-c,--card N select thecard
-D,--device N select the device, default'default'
-d,--debug debug mode
-n,--nocheck do notperform range checking
-v,--version printversion of this program
-q,--quiet be quiet
-i,--inactive show also inactivecontrols
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdinsequentially
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls(default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixersimple control
controls show all controls for givencard
contents show contents of all controlsfor given card
cset cID P set control contents for one control
cget cID get control contents for onecontrol
=============================================================
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。