-- 预先找到linein 输入端口的序号和名称
-- 录音服务启动的时候,先执行以下脚本,切换一下默认设备
#!/usr/bin/env bash
PRUN=`ps aux |grep pulseaudio | grep -v grep |wc -l`
echo "pulseaudio ps cnt: ${PRUN}"
if [ "${PRUN}"x == "0"x ]
then
echo "start pulseaudio...."
/usr/bin/pulseaudio --start --log-target=syslog
fi
echo "set default mic to line in..."
#pacmd set-source-port 1 analog-input-linein
pacmd set-source-port alsa_input.pci-0000_00_1b.0.analog-stereo analog-input-linein
pacmd list-sources |grep -e "index" -e "line"
来源:oschina
链接:https://my.oschina.net/mingyuejingque/blog/4695340