Bash script - Saving audio streams through fifo pipes ===================================================== Public Domain ******************************************************************************** ### fifo-save.sh #!/bin/bash FIFO="/tmp/bbc-fifo" while :; do [ ! -e $FIFO ] && mkfifo $FIFO FILE="BBC-R4X-$(date +%Y%m%d%H%M%S).mp3" ffmpeg -y -i $FIFO $FILE sleep 1 done ******************************************************************************** ### fifo-write.sh #!/bin/bash FIFO="/tmp/bbc-fifo" while :; do [ ! -e $FIFO ] && mkfifo $FIFO # env LD_PRELOAD=/lib/libtsocks.so \ mplayer -dumpstream -dumpfile $FIFO -cache 1024 \ "mms://wmlive-nonacl.bbc.net.uk/wms/bbc_ami/radio4/radio4xtra_bb_live_int_ep1_sl0" sleep 1 done ******************************************************************************** _BY: Pejman Moghadam_ _TAG: mkfifo, mplayer, ffmpeg, socks_ _DATE: 2013-11-29 16:05:13_