Multimedia
  Home arrow Multimedia arrow Page 5 - Network Radio With Icecast
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MULTIMEDIA

Network Radio With Icecast
By: Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 34
    2004-04-13

    Table of Contents:
  • Network Radio With Icecast
  • The Iceman Cometh
  • Source Control
  • Service with a Smile
  • Surfing the Stream
  • Facing the Music
  • Channeling the Energy
  • Web World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Network Radio With Icecast - Surfing the Stream


    (Page 5 of 8 )

    Streaming music to the server is handled by iceS, the source client. You may remember that you already compiled and installed this component a couple pages back -- now, all that's left is to use it. The first step in doing so is to build a playlist of tracks to be streamed to the server. This playlist is nothing but a plain text file containing absolute paths to the various audio files (OGG and MP3 files, in this case) to be streamed to the server, one per line. Here's what it might look like:

    /data/audio/pop/track11.ogg
    /data/audio/pop/track163.mp3
    /data/audio/pop/track26.ogg
    /data/audio/jazz/track126.ogg
    /data/audio/jazz/track107.ogg
    /data/audio/dance/track192.ogg
    /data/audio/dance/track748.mp3
    /data/audio/dance/track172.ogg

    If you have a large collection of audio files, the quickest way to create this file is to pipe the output of ls into a text file, as below:

    $ ls -1 /my/files/*.ogg > playlist.txt

    Once you've got the playlist created, hand it over to iceS to begin streaming the respective files, like this:

    $ /usr/local/icecast/bin/ices -h olympus.local.net -p 8000 -P abcdef -F
    /tmp/playlist.txt -m 80s -n "Local OGG Stream" -g "80s Stuff" -d "Good ol'
    pop, rock and jazz" -v -t http &
    Logfile opened
    DEBUG: Sending following information to libshout:
    DEBUG: Stream: 0
    DEBUG: Host: olympus.local.net:8000 (protocol: http)
    DEBUG: Mount: /80s, Password: abcdef
    DEBUG: Name: Local OGG Stream   URL: http://www.icecast.org/
    DEBUG: Genre: 80s Stuff Desc: Good ol' pop, rock and jazz
    DEBUG: Bitrate: 128     Public: 1
    DEBUG: Dump file: (null)
    DEBUG: Initializing playlist handler...
    DEBUG: Initializing builting playlist handler...
    DEBUG: Builtin playlist handler serving: /tmp/track11.ogg
    DEBUG: Filename cleaned up from [/tmp/track11.ogg] to [track1]
    Playing /tmp/track11.ogg
    Mounted on http://olympus.local.net:8000/80s
    DEBUG: Delaying metadata update...
    DEBUG: Updated metadata on 80s to: track1
    DEBUG: Updated metadata on 80s to: track1

    At this point, your audio file should be available as a stream to any interested listener. On the next page, I'll show you how to listen to what's playing...but first, a quick explanation of the various options to iceS on the command line above:

    $ /usr/local/icecast/bin/ices --help
    This is ices 0.3
    ices <options>
    Options:
            -B (Background (daemon mode))
            -b <stream bitrate>
            -c <configfile>
            -D <base directory>
            -d <stream description>
            -f <dumpfile on server>
            -F <playlist>
            -g <stream genre>
            -h <host>
            -i (use icy headers)
            -M <interpreter module>
            -m <mountpoint>
            -n <stream name>
            -p <port>
            -P <password>
            -R (activate reencoding)
            -r (randomize playlist)
            -s (private stream)
            -S <perl|python|builtin>
            -u <stream url>
            -v (verbose output)
            -H <reencoded sample rate>
            -N <reencoded number of channels>

    If you're sharp-eyed, you'll notice that my command line above includes an additional, undocumented parameter -- the -t parameter, which tells ices what protocol to use when communicating with the icecast server. For some reason, this option is missing from the help text displayed by iceS; expect this to be corrected in a future version of the application.

    You can also have iceS read these values from a configuration file, instead of specifying them on the command line. Consider the following configuration file, which is equivalent to the command options above:


    <?xml version="1.0"? >
    <ices:Configuration xmlns:ices="http://www.icecast.org/projects/ices">
      
    <Playlist>
        
    <File>/tmp/playlist.txt</File>
      
    </Playlist>
     
      <
    Execution>
        
    <Verbose>1</Verbose>
        
    <BaseDirectory>/tmp</BaseDirectory>
      
    </Execution>
     
      <
    Stream>
        
    <Server>
          
    <Hostname>olympus.local.net</Hostname>
          
    <Port>8000</Port>
          
    <Password>abcdef</Password>
          
    <Protocol>http</Protocol>
        
    </Server>
     
        <
    Mountpoint>/80s</Mountpoint>
        
    <Name>Local OGG Stream</Name>
        
    <Genre>80s Stuff</Genre>
        
    <Description>Good ol' pop, rock and jazz</Description>
     
      </Stream>
    </ices:Configuration>

    To have iceS read values from this file instead of the command line, simply tell it where to find the file, by using the -c option, as below:

    $ /usr/local/icecast/bin/ices -c /usr/local/icecast/etc/ices.conf

    For more configuration options, take a look inside the sample configuration file included with the iceS distribution.

    More Multimedia Articles
    More By Vikram Vaswani, (c) Melonfire


     

       

    MULTIMEDIA ARTICLES

    - Working with Colors in OpenGL for Game Progr...
    - Animation in OpenGL for Game Programming usi...
    - Game Programming with SDL: Getting Started w...
    - Using OpenGL with SDL for Game Programming
    - Learning Sound for Game Programming using SDL
    - Game Programming using SDL: Raw Graphics and...
    - Game Programming using SDL: Getting Started
    - Network Radio With Icecast
    - Learning To SMILe

    BlackBerry VTS




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway