L
L
lekam2020-05-06 23:00:53
ubuntu
lekam, 2020-05-06 23:00:53

How to use liquidsoap to play only new tracks from a folder?

How to monitor the contents of a folder using liquidsoap and stream them to Icecast if new files appear?
If a new file appears before the previous one has finished playing, then the new one is added to the queue.
If there are no new files, then nothing is played, but the broadcast is not interrupted.
The folder itself and Icecast are on the same machine running Ubuntu 18.04

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lekam, 2020-05-27
@lekam

Found two solutions.
First : records are made in the log about all reproduced files. Before playing a new file from a folder, we check if it is in the logs. If there is, we skip it, otherwise we play. Here is the script.
Second : you can add the tmp prefix:

playlist(prefix="tmp:", ...)
and then liquid will delete files after playback.
In both cases, the reload_mod="watch" parameter is needed so that the playlist is updated when new files appear.

Z
zersh, 2020-05-14
@zersh

specify reload for the playlist. more or less like this:

radio = playlist(reload=900, mode='random', "/mnt/vdb/reserv_mp3")

value in seconds

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question