Hi Richard,
I did not know there was such a nice wrapper from Centova. Looks nice!
To me, it looks like you could try the following in custom.liq:
def add_album_metadata_to_title(m) =
title = m["title"]
artist = m["artist"]
album = m["album"]
[("artist","Artist:#{artist}"),("title","Song:#{title} - Album:#{album}")]
end
centovacast.callback_all := map_metadata(add_album_metadata_to_title)
Romain
2017-07-28 7:00 GMT-05:00 Richard G Elen <[email protected]>:
> Hi... I am very new to Liquidsoap and I would like some help integrating a
> routine into Centova's Liquidsoap implementation.
>
> We want to modify the metadata sent to players from the AutoDJ so that it
> includes the Album tag as well as the Artist and Title. We can do this
> easily on live sources but not on the AutoDJ. All our AutoDJ audio files
> include a valid Album tag.
>
> A month or so ago, Eduardo Martinez kindly provided the following example
> to carry out what we want to achieve, using map_metadata. He of course
> didn't know about the environment in which this would operate so it's a
> general solution:
>
> ===
>
> input = playlist("/home/user/music",mode="normal")
>
> def apply_metadata(m) =
> title = m["title"]
> artist = m["artist"]
> album = m["album"]
> [("artist","Artist:#{artist}"),("title","Song:#{title} -
> Album:#{album}")]
> end
>
> input = map_metadata(apply_metadata,input2)
>
> ===
>
> This appears to simply append the Album tag to the Title tag, making the
> <title> metadata field take the form "Title - Album", which is perfect and
> exactly what we do with live sources.
>
> What I do not yet grasp is how to integrate that into the Centova
> implementation and I would love some pointers.
>
> Centova has a config file called "centova.liq" which you can't modify, but
> it includes "callbacks" - essentially hooks to allow the addition of extra
> processing - which call routines in a file called "custom.liq".
>
> The callback for the AutoDJ in the centova.liq file is:
>
> ===
>
> # callback to modify autoDJ stream; accepts and must return a source
> centovacast.callback_autodj = ref fun(s) -> s
>
> ===
>
> and the standard default custom.liq file consists of:
>
> ===
>
> # This file will not be modified by Centova Cast. If you wish to add
> custom Liquidsoap
> # scripting to your stream, add it here and it will automatically be
> imported by Liquidsoap.
> #
> # Note: to add additional processing to the Liquidsoap sources managed by
> Centova Cast,
> # refer to the centovacast.callback_* functions and their comments at the
> top of centovacast.liq.
> #
> # Example: When streaming from a live source, amplify by 2.0.
> # centovacast.callback_live := fun(s) -> amplify(2.0,s)
> #
> # Example: Add an echo effect to streams from all sources.
> # centovacast.callback_all := fun(s) -> echo(id="custom_echo",delay=0.
> 5,feedback=-6,s)
>
> ===
>
> I would be most grateful if someone could tell me what the custom.liq file
> should contain to allow AutoDJ sources to have their metadata processed as
> we want by Mr Martinez's routine and successfully passed back. Mr
> Martinez's routine is a little more extensive than the examples and I
> simply don't know the scripting language well enough yet to work it out and
> would appreciate some help. Sorry this is such a basic query.
>
> Many thanks in advance!
> --Richard E
>
>
> ------------------------------------------------------------
> ------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users