As I was dorking about with PiFM I took a few moments to find a bit of code to create a playlist of all the mp3 in under the content/Radio/ directory and make that playlist the default start up media. Sprinkle the randomness and all that is needed are cheesy bumpers.
cd /home/pi/content/Radio
find /home/pi/content/Radio/ -type f \( -name "*.mp3" \) | sort > /home/pi/content/Radio/playlist.m3u
chmod a+rx /home/pi/content/Radio/playlist.m3u
Now you just need to change a line in the VLC startup scriptsudo nano /etc/vlc/start.sh
Find the line that ends with /home/pi/content/Radio/welcome.mp3and replace that part with.
/home/pi/content/Radio/playlist.m3u
Reboot the server
sudo sync sudo rebootPower off and power back up.
All the mp3 files will now be served up in their time.
"I am a D.J., I am what I play" D.B.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.