#!/bin/sh echo "record_radio v0.2" if [ "$1" = "-h" ] || [ "$1" = "" ] ; then cat << EOF USAGE : ./record_radio num duree type "num" est le numéro de radio à enregistrer : 1) Europe 1 2) France Culture 3) France Info 4) France Inter 5) Fip 6) France Musiques 7) Le Mouv 8) Nostalgie 9) Fun Radio 10) NRJ 11) Oui FM 12) Europe2 13) Rires et Chansons 14) RFM 15) RTL2 16) RTL 17) France Bleu Orléans 18) RMC "duree" est la duree en secondes de l'enregistrement. "type" est le type d'encodage : mp3 ou ogg. Exemple : ./record_radio 4 3600 ogg pour enregistrer 1H de France Inter en ogg/vorbis. EOF exit fi num=$1 [ "$2" = "" ] && duree=60 || duree=$2 [ "$3" = "" ] && type=ogg || type=$3 case $num in "1" ) radio="mms://vip8.yacast.fr/encodereurope1" nom="Europe1" ;; "2" ) radio="http://ogg.tv-radio.fr:1441/encoderfculture.ogg" nom="FranceCulture" ;; "3" ) radio="http://ogg.tv-radio.fr:1441/encoderfinfo.ogg" nom="FranceInfo" ;; "4" ) radio="mms://viptvr2.yacast.net/encoderfranceinter" nom="FranceInter" ;; "5" ) radio="http://ogg.tv-radio.fr:1441/encoderfip.ogg" nom="Fip" ;; "6" ) radio="http://ogg.tv-radio.fr:1441/encoderfmusiques.ogg" nom="FranceMusiques" ;; "7" ) radio="http://ogg.tv-radio.fr:1441/encoderlemouv.ogg" nom="LeMouv" ;; "8" ) radio="mms://vip1.yacast.fr/encodernostalgie" nom="Nostalgie" ;; "9" ) radio="mms://vip2.yacast.fr/encoderfun1" nom="Fun" ;; "10" ) radio="mms://vip1.yacast.fr/encodernrj" nom="Nrj" ;; "11" ) radio="mms://vipbu.yacast.fr/encoderouifm" nom="OuiFM" ;; "12" ) radio="mms://a1234.m.akastream.net/D/1234/5905/001/reflector:21100" nom="Europe2" ;; "13" ) radio="mmst://vip1.yacast.fr/encoderrireetchansons" nom="RireEtChansons" ;; "14" ) radio="mms://viptvr.yacast.fr/tvr_rfm" nom="Rfm" ;; "15" ) radio="mms://vip2.yacast.fr/encoderrtl2" nom="Rtl2" ;; "16" ) radio="mms://vip2.yacast.fr/encoderrtl" nom="Rtl" ;; "17" ) radio="mms://viptvr.yacast.net/tvr_francebleuorleans?site" nom="FranceBleuOrleans" ;; "18" ) radio="-playlist http://cache.yacast.fr/V4/rmc/rmc.asx" nom="Rmc" esac rm -f audiodump.wav 2>/dev/null mkfifo audiodump.wav mplayer -cache 128 -ao pcm:waveheader:file=audiodump.wav -vc dummy -vo null $radio & sleep 10 if [ "$type" = "ogg" ]; then oggenc -q 4 audiodump.wav -o ${nom}-`date +'%d_%B-%Hh%Mm%Ss'`.ogg & else lame --preset standard audiodump.wav ${nom}-`date +'%d_%B-%Hh%Mm%Ss'`.mp3 & fi sleep $duree killall mplayer if [ "$type" = "ogg" ]; then killall oggenc else killall lame fi rm -f audiodump.wav