# $Id: convert.conf,v 1.28 2004/08/13 20:15:52 sadams Exp $
# configuration file for transcoding
# first line is the source format, destination format and the destination device.  Asterisk matches all
# second line is the command line for the conversion

# First line format: 
#      <source_format> <dest_format> <destination_device_type> <destination_device_id>
# 
#   <source_format>:   Source music format:  mp3, mov, ogg, wav, etc...
#   <dest_format>  :   Destination music format:  Generally mp3, or
#                      possibly aif or others depending on the types
#                      your player supports.  SliMP3 supports only
#                      MP3.  Squeezebox currently supports mp3, aif
#                      and wav.
#   <destination_device_type>:  currently slimp3, squeezebox, or *.
#                      The * is a wildcard that matches all device
#                      types. 
#   <destination_device_id>:  The ID of the destination device.  The
#                      ID of the destination device is the MAC address
#                      of a SliMP3 or Squeezebox device, or the IP of
#                      an HTTP client (such as your computer running
#                      WinAmp). The '*' wildcard matches all hosts
# 
#   either or both of <destination_device_type> and
# <destination_device_id> may be the '*' wildcard
# 
#
# $FILE$ is the absolute path to the source file
# $RATE$ is the sample rate of the source file (in kS/sec)
# $BITRATE$ is the bandwidth of the output stream in kb/s
# [bin] is the executable binary for the encoder or decoder
# - is a special command line that implies passthrough of data

# specific combinations match before wildcards

mov mp3 * *
	[mov123] $FILE$ | [lame] --resample 44100 --silent -q 9 -b $BITRATE$ -r - -

ogg mp3 * *
	[oggdec] -Q -o - -R $FILE$ | [lame] --resample 44100 --silent -b $BITRATE$ -r $-x$ - -

wav mp3 * *
	[lame] --resample 44100 --silent -q 9 -b $BITRATE$ $FILE$ -

aif mp3 * *
	[lame] --resample 44100  --silent -q 9 -b $BITRATE$ $FILE$ -

shn mp3 * *
	[shorten] -x $FILE$ - | [lame] --resample 44100  --silent -q 9 -b $BITRATE$ - -

flc mp3 * *
	[flac] -dcs $FILE$ | [lame] --resample 44100  --silent -q 9 -b $BITRATE$ - -

# Comment out previous entry and uncomment this entry to use cuesheets with FLAC files
# This is buggy with FLAC 1.1 or earlier
#flc mp3 * *
#	[flac] -dcs --skip=$START$ --until=$END$ $FILE$ | [lame] --resample 44100  --silent -q 9 -b $BITRATE$ - -

wma mp3 * *
	[wmadec] -r 44100 -b 16 -n 2 $FILE$ | [lame] -x --resample 44100  --silent -q 9 -b $BITRATE$ - -

mpc mp3 * *
	[mppdec] --raw-le --silent --prev --gain 3 $FILE$ - | [lame] -x --resample 44100  --silent -q 9 -b $BITRATE$ - -

mp3 mp3 * *
	-

# Non-mp3 starts here
aif aif * *
	-
#	~/slim/tools/visualizer/vis 10.0.1.7 $FILE$

wav wav * *
	-

shn wav * *
	[shorten] -x $FILE$ -

flc wav * *
	[flac] -dcs --force-raw-format --endian=little --sign=signed $FILE$

# Comment out previous entry and uncomment this entry to use cuesheets with FLAC files
# This is buggy with FLAC 1.1 or earlier
#flc wav * *
#	[flac] -dcs --force-raw-format --endian=little --sign=signed --skip=$START$ --until=$END$ $FILE$

ogg wav * *
	[oggdec] -Q -o - -R $FILE$

wma wav * *
	[wmadec] -r 44100 -b 16 -n 2 $FILE$ 

mpc wav * *
	[mppdec] --raw-le --silent --prev --gain 2 $FILE$ -

mpc aif * *
	[mppdec] --raw-be --silent --prev --gain 2 $FILE$ -

## you can comment this out if you want to use LAME to transcode AAC/MOV files to MP3.
mov aif * *
	[mov123] $FILE$

# special case for smart bitrates on mp3 input
mp3 lame * *
	[lame] --resample 44100 --silent -b $BITRATE$ $FILE$ -


# This example transcodes MP3s to MP3s, if the target machine has the 
# given MAC address.  This rule will take precedence over the
# previous rule because it's more specific.  
#mp3 mp3 squeezebox 00:02:dd:34:e9:62
#	./brute_filter $FILE$ -
