Hi Unosonic
Been playing with this and getting an error on the following line:
chilled = on_metadata(fun (meta) -> system("/home/liquids/test.php " ^
quote(meta["channel"]) ^ " &"), chilled)
I cant figure out where the syntax is wrong. The whole script as follows:
# Put the log file in some directory where
# you have permission to write.
set("log.file.path","/var/log/liquidsoap/chilled.log")
# Print log messages to the console,
# can also be done by passing the -v option to liquidsoap.
set("log.stdout", false)
# Music
music = (playlist.safe(mode="normal",reload=600,"/home/liquids/playlist"))
music = rewrite_metadata(
[("channel",'$(if $(channel_id),"$(channel_id)","$(channel)")'),
("track", '$(if
$(current_track),"$(current_track)","$(track)")')],music)
# Some jingles
#jingles = playlist("~/radio/jingles.m3u")
# If something goes wrong, we'll play this
security = single("/backup/backup.mp3")
# Start building the feed with music
chilled = music
# Now add some jingles
#radio = random(weights = [1, 4],[jingles, radio])
# And finally the security
chilled = on_metadata(fun (meta) -> system("/home/liquids/test.php " ^
quote(meta["channel"]) ^ " &"), chilled)
chilled = fallback(track_sensitive = false, [chilled, security])
# Stream it out
output.icecast(%mp3,
host = "icecast.mydomain.com", port = 8000,
password = "mypassword", mount = "test.mp3",
chilled)
Can you see where its failing? Error is:
Line 25, char 39 before "\" ^ quote(meta[\"": Parse error!
Thankyou
Dane
unosonic <mailto:[email protected]>
7 January 2015 22:44
in your liq-file:
playlist = playlist(playlist_file)
playlist = rewrite_metadata(
[("artist",'$(if $(my_artist),"$(my_artist)","$(artist)")'),
("title", '$(if $(my_title),"$(my_title)","$(title)")')],playlist)
and in playlist_file use the annotate protocol:
annotate:my_title="my title 1",my_artist="someone":/path/to/file1.mp3
annotate:my_title="my title 2",my_artist="someone else":/path/to/file2.mp3
...
you can also define your own metadata tags, e.g. my_id
annotate:my_title="my
title",my_artist="someone",my_id="id1":/path/to/file2.mp3
and then do something with it:
radio = on_metadata(fun (meta) -> system("/path/to/your/script.php " ^
quote(meta["my_id"]) ^ " &"), radio
which would exec "/path/to/your/script.php id1 &" every time metadata
appears, e.g.
on track change.
good luck, u.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media,
is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users
Dane Streeter <mailto:[email protected]>
7 January 2015 22:23
Hi All
I'm not sure if any of my messages do get through on here as i dont
think ive ever had a reply to any of my questions :(
I have a script at the moment that reads a playlist and outputs this
to icecast - very simple.
I am looking to edit this so that I can get the track metadata posted
to me elsewhere when the track changes in the playlist. I have found
the on.track function which specifies that track meta data is used as
argument.
A few questions:
- is on.track the right function to be using?
- how can i pass this argument of meta data outside of liquid soap?
- Ive seen theres http.get so I could call an external URL however Im
unsure on how to expose the on.track argument to pass using http.get
- Am I missing something altogether that will allow me know know what
track is playing when the track changes?
Any help is greatly appreciated, im so stuck!
Thank you
Dane
--
Regards
Dane Streeter
Managing Director
Sharpstream Ltd
O: 0800 999 2468
DD: 01273 921196
Emergency? [email protected]
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users