RDS Metadata

RDS Metada works now as in Streaming Extension (Serveur v4). See Metadata_Scripts.

Metadata source kind can be:

  • File/URL: In this case, use the Source field to set the file path or the URL. You may use User/Password and poll time for ftp and http URLs.
  • TCP Server: will listen on the port set in "Source Port". It can optionally be bind to an IP, if the PC has multiple IP. This uses the PC/Admin IP, not the board.

Then, you need to select a parser.

Parsers are scripts in the LUA language. This is well documented on the Web.

The easier is to use XML. The script support to use XPath for XML parsing. This is also well documented on the Web and very flexible.

You need to put scripts in(see Files directories):

  • Windows: C:\ProgramData\SOUND4\Server\Data\metaparsers
  • Linux: /opt/sound4/Data/rdsmetaparsers
  • Standalone: \\rdsmetadataparser\

A script called "MyParser.lua" should appear after in the "Metadata parsers" listed as "MyParser".

For instance, to parse this XML file:

<live>
    <radio_id>Oldies Network</radio_id>
    <current_song>
        <Startime>17:53:14</Startime>
        <artist><![CDATA[THE CHRISTIANS]]></artist>
        <title><![CDATA[WHATS IN A WORD]]></title>
        <duration>00:04:49</duration>
        <cover_url>http://www.allcdcovers.com/image_system/images/f/4/f4efd22a515abcace470f093c26633fd.jpg</cover_url>
        <categorie>G</categorie>
    </current_song>
</live>

The MyParser.lua can be written like this:

UseXmlParser()

function OnXMLParsed()
    local artist=XPath('//current_song/artist/text()')
    local title=XPath('//current_song/title/text()')
    meta:Add("title", title)
    meta:Add("artist", artist)
end

This script means:

UseXmlParser() Set the script in XML mode parsing

function OnXMLParsed() Function called when XML has been parsed

local artist=XPath('//current_song/artist/text()') Create a variable artist, using XPath to extract the artist content that is in <whatever><current_song><artist>name</...

local title=XPath('//current_song/title/text()') Create a variable title, using XPath to extract the title content that is in <whatever><current_song><title>name</...

meta:Add("title", title) Set the metadata field title to the value we got

meta:Add("artist", artist) Set the metadata field artist to the value we got

end End of function

You can then use the metadata values in all Dynamic fields with {artist} and {title}.

For instance, set Dynamic RT: "RT Use Dynamic" = Yes, Mode= User and set "Dynamic RT"="Now playing {title} by {artist}"