If you want to record Internet Radio streams (in MP3 format) to play songs in offline mode later with Madplay, you just need to install streamripper program.
opkg update
opkg install streamripper
"cd" to the directory you want to use for saving your MP3s
example:
cd /mnt/external_flash
note: don't save MP3s into the internal router flash memory otherwise you will fill it in a second
then use this simple command:
/usr/bin/streamripper stream-url
example:
/usr/bin/streamripper http://stream.srg-ssr.ch/m/rsj/mp3_128
Note: you won't hear any audio during ripping.
To stop ripping press "Ctrl+c" otherwise Streamripper will run indefinitely.
If you want to limit the total space occupied by ripped MP3s, you can limit streamripper using "-M megabytes" option to be added to the end of the above command line, or to limit streamripper in time by fixing a maximum time for it to run, you can use "-l seconds" option.
[Optional] You may also want to fix MP3s variable bit rate with Vbrfix:
http://tuxtweaks.com/2012/03/fixing-var … th-vbrfix/
To remove spaces from MP3 filenames in current directory and convert them to underscores (not recursive):
for f in *\ *; do mv "$f" "${f// /_}"; done
Single line command (not recursive) to play in sequence all .mp3 files present in a directory using Madplay:
/usr/bin/find /mnt/external_flash -name \*[mM][Pp]3 | /usr/bin/awk '{print "\""$0"\""}' | /usr/bin/xargs /usr/bin/madplay - &
or if you prefere playing them randomly:
/usr/bin/find /mnt/external_flash -name \*[mM][Pp]3 | /usr/bin/awk '{print "\""$0"\""}' | /usr/bin/xargs /usr/bin/madplay -z - &
(Last edited by pilovis on 18 May 2015, 20:28)