close
長時間測試錄音與放音
發現 aplay 4小時半 自動停止問題..
查看原始碼 似乎有 timelimit所以只好手動改播放腳本
去偵測aplay 是否存在...若不在就重新啟動aplay
mplayer -vo x11 -tv driver=v4l2:device=/dev/video0:input=1:norm=NTSC:width=$W:height=$H:outfmt=bgr32 tv:///0 &
arecord -r 48000 -c 2 -f S16_LE -D hw:1,0 | aplay &
while [ 1 ]
do
arecod_flag=$(ps aux | grep arecord | awk '{ print $11 }' | head -n 1)
#echo "arecod_flag=$arecod_flag"
#arecord_str=arecord
run_flag=0
[ "$arecod_flag" = "arecord" ] && run_flag=0 || run_flag=1
if [ $run_flag -eq "1" ]; then
killall arecord aplay
arecord -r 48000 -c 2 -f S16_LE -D hw:1,0 | aplay &
fi
sleep 5
done
全站熱搜
留言列表