[icecast] Metadata once more...with Ices

Cédric Mallet malletc3 at cti.ecp.fr
Thu Mar 28 16:12:01 PST 2002



jeudi 28 mars 2002, 18:50:01, Brendan Cully a écrit :
> I haven't kept your original posts, so I don't know if you've already
> given this information, but I'd like to see your ices config file. If
> you're using a playlist script I'd like to see the ices_get_metadata
> function (if you've written one). Also, run ices in debug mode and it
> should show the title information it's sending to icecast for each
> track.

Here is everything you need :

     Ices.conf :

<?xml version="1.0"?>
<ices:Configuration xmlns:ices="http://www.icecast.org/projects/ices">

  <Playlist>
        <File>/home/ced/projet/ices/playlist</File>
        <Randomize>0</Randomize>
        <Type>perl</Type>
        <Module>ices</Module>
 </Playlist> 

 <Execution>    
      <Background>0</Background>
      <Verbose>0</Verbose>
     <BaseDirectory>/tmp</BaseDirectory>
 </Execution>

  <Stream>
    <Server>
     <Hostname>mallet.via.ecp.fr</Hostname>
      <Port>8000</Port>
      <Password>pass</Password>
      <Protocol>xaudiocast</Protocol>
    </Server>
   <Mountpoint>ices</Mountpoint>

   <!-- The name of the dumpfile on the server for your stream. DO NOT set
         this unless you know what you're doing.
    <Dumpfile>ices.dump</Dumpfile>  -->

    <Name>RadioPI - Rediffusions par IceS</Name>
    <Genre>Cool ices genre from XML</Genre>
    <Description>Cool ices description from XML</Description>
    <URL>Cool ices URL from XML</URL>
    <Public>0</Public>
    <Bitrate>128</Bitrate>
    <Reencode>1</Reencode>
    <Channels>2</Channels>
  </Stream>
</ices:Configuration>

<p>And the ices_get_metadata from ices.pm :

use MP3::Info;
sub ices_get_metadata {
        my $tag = get_mp3tag("$mp3");
        my $title = $tag->{TITLE};
        my $artist = $tag->{ARTIST};
        my $id = $mp3;

        if ( ($title eq "") || ($artist eq "") ) {

        # A few ugly operations to get the name of the song from the file name...
        # I know there must be something nicer, but it works :)

                $id =~ s#[^/]*/##g;
                $id =~ s#/##g;
                $id =~ s#.mp3##g;
                $id =~ s#_# #g;
                        }
        else {
                $id = "$artist - $title"; 
#               print "Id OK\n";
                }
        return "Radio blabla - $id";
}

<p>Thank you for your time :)

Ced

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Icecast mailing list