<?xml version="1.0"?>
<ices>

	

    <!-- run in background  -->
    <background>0</background>
    <!--  Set to 1 if you want IceS to put itself into the background.  -->
    
    
    <!-- where logs go. -->
    <logpath>/var/log/ices</logpath>
    <!--  A directory that can be written to by the user that IceS runs as. This can be anywhere you want but as log files are created, write access to the stated must be given. -->
    
    <logfile>ices.log</logfile>
    <!--  The name of the logfile created. On log re-opening the existing logfile is renamed to <logfile>.1 -->
	    
	    
    <!-- size in kilobytes -->
    <logsize>2048</logsize>
    <!--  When the log file reaches this size (in kilobytes) then the log file will be cycled (the default is 2Meg) -->
    
    
    <!-- 1=error, 2=warn, 3=infoa ,4=debug -->
    <loglevel>4</loglevel>
    <!--  A number that represents the amount of logging performed.
	  * 1 - Only error messages are logged
	  * 2 - The above and warning messages are logged
	  * 3 - The above and information messages are logged
          * 4 - The above and debug messages are logged  -->
    
    
    <!-- logfile is ignored if this is set to 1 -->
    <consolelog>0</consolelog>
    <!--  A value of 1 will cause the log messages to appear on the console instead of the log files. Setting this to 1 is generally discouraged as logs are cycled and writing to screen can cause stalls in the application, which is a problem for timing critical applications. -->
    
    
    <!-- optional filename to write process id to -->
    <!-- <pidfile>/home/ices/ices.pid</pidfile> -->
    <!--  State a filename with path to be created at start time. This file will then contain a single number which represents the process id of the running IceS. This process id can then be used to signal the application of certain events. -->

    
    
    
    <stream>
        <!-- metadata used for stream listing -->
        <metadata>
            <name>Example stream name</name>
            <genre>Example genre</genre>
            <description>A short description of your stream</description>
            <url>http://mysite.org</url>
        </metadata>
	<!--  This section describes what metadata information is passed in the headers at connection time to icecast. This applies to each instance defined within the stream section but maybe overridden by a per-instance <metadata>  section. -->

		
		
		
		
        <!--    Input module.

            This example uses the 'alsa' module. It takes input from the
            ALSA audio device (e.g. line-in), and processes it for live
            encoding.  -->
        <input>
            <module>alsa</module>
	    <!--   The Advanced Linux Sound Architecture (ALSA) is a completely different sound system on linux but provides OSS compatability so the OSS driver should work with it as well. To use ALSA natively a separate module is used -->
	    
	    
            <param name="rate">44100</param>
	    <!--  The value is in hertz, 44100 is the samplerate used on CD's, but some drivers may prefer 48000 (DAT) or you may want to use something lower. -->
	    
	    
            <param name="channels">2</param>
	    <!--  The number of channels to record. This is typically 2 for stereo or 1 for mono -->
	    
	    
            <param name="device">hw:0,0</param>
	    <!--  This is the device name as used in ALSA. This can be a physical device as in the case of "hw:0.0" or a virtual device like one with dsnoop.-->
 	    
	    
	    <param name="periods">2</param>
	    <!--  This specifies how many interrupts will be generated (default: 2) -->
	    
	    
	    <param name="buffer-time">500</param>
	    <!--  The size of the buffer measured in mS (default 500)-->
	    
	    
            <param name="metadata">1</param>
	    <!--   Check for metadata arriving, if any are present then the data is marked for an update. The metadata is in the form of tag=value, and while Ogg Vorbis can handle any supplied tags, most players will only do anything with artist and title  -->
	    
	    
            <param name="metadatafilename">test</param>
	    <!--  The name of the file to open and read the metadata tags from, with this parameter missing standard input is read. Using a file is often the better approach. When using the file access the procedure is usually to populate the file contents then send a SIGUSR1 to the IceS process.
	   The format of the file itself is a simple one comment per line format, below is a trivial example of the file, other tags can be used but players tend to only look for artist and title for displaying. The data must be in UTF-8 (this is not checked by ices, however).  -->
	    
	    
        </input>
	<!--  This section deals with getting the audio data into IceS. There are a few ways that can happen. Typically it's either from a playlist or via a soundcard.
        The layout is consistent between the different input modules. Within the input section a module tag is needed to identify the module in question. The rest are made up of param tags specific to the module. There can be several param tags supplied to a module. Details of the module parameters are shown later. -->
	

	
	
        <!--    Stream instance.

            You may have one or more instances here.  This allows you to
            send the same input data to one or more servers (or to different
            mountpoints on the same server). Each of them can have different
            parameters. This is primarily useful for a) relaying to multiple
            independent servers, and b) encoding/reencoding to multiple
            bitrates.

            If one instance fails (for example, the associated server goes
            down, etc), the others will continue to function correctly.
            This example defines a single instance doing live encoding at
            low bitrate.  -->

        <instance>
            <!--    Server details.

                You define hostname and port for the server here, along
                with the source password and mountpoint.  -->

            <hostname>localhost</hostname>
	    <!--  State the hostname of the icecast to contact, this can be a name or IP address and can be ipv4 or ipv6 on systems that support IPv6. The default is localhost. -->
	    
	    
            <port>8000</port>
	    <!--   State the port to connect to, this will be the port icecast is listening on, typically 8000 but can be any. -->
	    
	    
            <password>hackme</password>
	    <!--    For providing a stream, a username/password has to be provided, and must match what icecast expects. -->
	    
	    
            <mount>/example1.ogg</mount>
	    <!--    Mountpoints are used to identify a particular stream on a icecast server, they must begin with / and for the sake of certain listening clients should end with the .ogg extension. -->
	    
	    
            <yp>1</yp>
	    <!--  By default streams will not be advertised on a YP server unless this is set, and only then if the icecast if configured to talk to YP servers. -->
	    

	    
	    
            <!--    Live encoding/reencoding:

                channels and samplerate currently MUST match the channels
                and samplerate given in the parameters to the oss input
                module above or the remsaple/downmix section below.  -->

            <encode>  
                <quality>0</quality>
		<!-- stereo-> State a quality measure for the encoder. The range goes from -1 to 10 where -1 is the lowest bitrate selection (default 3), and decimals can also be stated, so for example 1.5 is valid. The actual bitrate used will depend on the tuning in the vorbis libs, the samplerate, channels and the audio to encode. A quality of 0 at 44100hz and 2 channels is typically around the 64kbps mark. -->	
		
		
                <samplerate>22050</samplerate>
		<!--  State the samplerate used for the encoding, this should be either the same as the input or the result of the resample. Getting the samplerate wrong will cause the audio to be represented wrong and therefore sound like it's running too fast or too slow. -->
		
		
                <channels>1</channels>
		<!--   State the number of channels to use in the encoding. This will either be the number of channels from the input or 1 due to downmix. -->
		
		
		
		
            </encode>

            <!-- stereo->mono downmixing, enabled by setting this to 1 -->
            <downmix>1</downmix>
	    <!--  Some streams want to reduce the bitrate further, reducing the number of channels used to just 1. Converting stereo to mono is fairly common and when this is set to 1 the number of channels encoded is just 1. Like resample, this only affects the one instance it's enabled in.  -->
	    
	    
	    <!-- save your stream on a hard disk -->
	    <savefile>/home/ices/dump/stream1.ogg</savefile>
	    <!-- Sometimes the stream transmitted wants to be saved to disk. This can be useful for live recordings. -->
	    
	    
            <!-- resampling.
            
                Set to the frequency (in Hz) you wish to resample to, -->
             
            <resample>
                <in-rate>44100</in-rate>
                <out-rate>22050</out-rate>
            </resample>
	    <!-- When encoding or re-encoding, there is a point where you take PCM audio and encode to Ogg Vorbis. In some situations a particular encoded stream may require a lower samplerate to achieve a lower bitrate. The resample will modifiy the audio data before it enters the encoder, but does not affect other instances.
	    The most common values used are 48000, 44100, 22050 and 11025, and is really only used to resample to a lower samplerate, going to a higher rate serves no purpose within IceS. -->
	    
	    
        </instance>

    </stream>
</ices>

