miegl / PiFmAdv

Advanced Raspberry Pi FM transmitter with RDS encoding
GNU General Public License v3.0
492 stars 84 forks source link

Adding source as a playlist of songs #83

Closed eoinparkinson closed 3 years ago

eoinparkinson commented 3 years ago

Hi,

I'm using this script to play audio files and it has been working great, however I'm struggling to find any documentation anywhere about playing files from a playlist.

I've tried creating a custom bash script to loop through every audio file in a folder but I've had no luck.

Would this be a correct approach, or is there a feature of this program that I have missed?

Many thanks, Eoin.

eoinparkinson commented 3 years ago

Fixed by creating a folder in the pifm directory called "sounds", and adding a custom bash script in the parent directory which calls the pifm program for every file in the sounds folder.


#!/bin/bash
for filename in ~/pifm-master/sounds/*.wav; do
        echo "Now Playing: " $filename;
        sudo ~/pifm-master/pifm $filename 104.9 48000 stereo
done