(1)mixer设置音量配置
SOUND_MIXER_VOLUME 主音量调节
SOUND_MIXER_RECLEV 录音音量
示例:
#include <linux/soundcard.h>
int fd,iLevel,iRight,iRight;
fd= open("/dev/mixer", O_WRONLY);
iLevel = (iRight << 8) + iLeft;
ioctl(fd, MIXER_WRITE(SOUND_MIXER_VOLUME),&iLevel);
(2)madplay设置采样频率:可以解决播放mp3文件语速过快的问题
system("/bin/madplay --sample-rate=65535 /mp3/left.mp3");
时间: 2024-10-12 20:06:05