Author Topic: Swapping songs within a playlist that is playing?  (Read 483 times)

Offline TechGuy

  • Newbie
  • *
  • Join Date: Oct 2015
  • Location:
  • Posts: 8
  • Kudos: 0
Swapping songs within a playlist that is playing?
« on: December 01, 2017, 07:23:31 AM »
Would it be possible to write a script that would swap in/out some of the announcements in a playlist that is already playing? When we go outside to hand out candy canes, I'd like to change the usual "don't block the driveways" message, but then easily be able to change it back without restarting the show. Thanks for any ideas!

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,732
  • Kudos: 204
Re: Swapping songs within a playlist that is playing?
« Reply #1 on: December 01, 2017, 09:58:26 AM »
You can't currently edit a running playlist, but you could run a script which copied over the mp3 file with another one and FPP would happily play the new one when it got to that point in the playlist.

There are some other examples in the forum, but essentially you want a pair of scripts that look like this:

Code: [Select]
#!/bin/sh

# copy the outside walking around announcement so it plays while walking around inside
FILE1="MyOutsideWalkingAroundAnnouncement.mp3"
FILE2="TheNameOfTheMP3InMyPlaylist.mp3"

MUSICDIR="/home/fpp/media/music"

cp ${MUSICDIR}/${FILE1} ${MUSICDIR}/${FILE2}


Code: [Select]
#!/bin/sh

# copy the normal announcement back into place so we can go back inside and get some hot chocolate
FILE1="MyNormalAnnouncement.mp3"
FILE2="TheNameOfTheMP3InMyPlaylist.mp3"

MUSICDIR="/home/fpp/media/music"

cp ${MUSICDIR}/${FILE1} ${MUSICDIR}/${FILE2}

Update the FILE1 and FILE2 variables to have your correct filenames and run the scripts via the FPP File Manager's Scripts tab.
-
Chris

Offline TechGuy

  • Newbie
  • *
  • Join Date: Oct 2015
  • Location:
  • Posts: 8
  • Kudos: 0
Re: Swapping songs within a playlist that is playing?
« Reply #2 on: December 04, 2017, 01:57:53 PM »
Thanks, Captain!

 

Back to top