This appears to work, but I'm curious if those of you more familiar with
this scripting see a more efficient solution?

set("server.socket",true)
set("server.socket.path","path/to/socket")
# points to a single blank .mp3 file
silence = mksafe(playlist("./silence.m3u"))

# If there is anything in the queue, play it.  If not, play the silence
defined above repeatedly:
radio = fallback([ request.queue(), silence])

# Connect to icecast and play the radio object defined above:
output.icecast(%mp3(stereo=false),
                host="192.168.1.1", port = 8000,
            user = "test", password = "test", mount = "/test",
   radio)

Then, this works to push items into the queue and they appear to play
immediately:

echo "queue.push /path/to/file" | socat ./socket -

So some questions:

- Is there a better in-script way to generate silence until the queue is
populated without having to reference a file?
- Does anyone have any perl, python or php examples for connecting to the
socket that work?  Struggling with that.
- Is there any overall better way to accomplish what I'm doing?
- What is the best way to define the meta data for each file I am placing
on the queue?
- Why would I be generating these just looping the blank mp3 file but not
appear to actually be out of sync:

2017/01/21 02:50:44 [clock.wallclock_main:2] We must catchup 43.84 seconds
(we've been late for 100 rounds)!
Some back story:

I am generating audio files off of SDR dongles and each .wav file belongs
to a specific police/fire talk-group.  I want to selectively stream certain
files towards a broadcastify.com stream in sequence and if possible I want
to define the metadata with the name of the agency each audio file belongs
to, and some of these transmissions are really brief so defining it in a
timely manner is important.

Thanks

On Fri, Jan 20, 2017 at 8:59 PM, Jeff Garvas <j...@cia.net> wrote:

>
> I've been reading some cookbook examples but I think my use case scenario
> is unusual.   I am generating small .mp3 files that I would like to be able
> to sequentially inform a running liquidsoap instance about, and have it
> play them in the order that they arrive.
>
> When there are no .mp3 files in the queue I want it to play silence.  My
> thinking is a 1 second .mp3 infallible file of silence would do the trick?
>
> What is the best way to build the queuing mechanism and inform liquidsoap
> of new items?   Is there a way to delete the file after it was played?
>
> Thanks
>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to