[vorbis] Ogg too good?

Jonathan Walther krooger at debian.org
Sat Mar 9 02:01:59 PST 2002


On Thu, Mar 07, 2002 at 06:16:35PM -0800, Nathan I. Sharfi wrote:
>> I have a different solution, which stands me in good stead.  For each
>> "CD", all the flac files go in a directory.  Then there is a "tags"
>> file in that directory.  Here is an example of a "tags" file:
>>
>> a ALBUM="Bob Marley"
>> a LABEL="Sony Music Canada"
>> a PERFORMER="Bob Marley"
>> a GENRE="reggae"
>> t 01 TITLE="Concrete Jungle"
>> t 02 TITLE="Slave Driver"
>> t 03 TITLE="400 Years"
>> t 04 TITLE="Stop That Train"
>> t 05 TITLE="Baby We've Got A Date"
>> t 06 TITLE="Stir It Up"
>> t 07 TITLE="Kinky Reggae"
>> t 08 TITLE="No More Trouble"
>
>Tease. How did you define a() and t() in bash?

It's not even bash; just good old bourne shell.

It assumes your ogg files all have names of the form Track_NN.ogg
where NN stands for the track number.

$ cat ~/bin/tag
#!/bin/sh

usage () {
  cat <<EOF
Usage: tag <directory>

Specify the directory where the oggs to be tagged
are located.  The "tags" file must be present and
all oggs should be from the same disc.
EOF
  exit 1;
}

if [ "$1" = "" -o ! -d $1 -o ! -f $1/tags ] ; then
  usage;
fi

cd $1
rm -f *.tags;

a () { echo "$@" >> disc.tags; }
t () { T=$1; shift; echo "$@" >> track$T.tags; }

. tags;

for i in track*.tags; do
  i=$(echo $i|sed 's/^track//g'|sed 's/.tags$//g')
  if [ -f Track_$i.ogg ] ; then 
    vorbiscomment -w Track_$i.ogg -c disc.tags
    vorbiscomment -a Track_$i.ogg -c track$i.tags
    vorbiscomment -a Track_$i.ogg -t "TRACKNUMBER=$i"
  fi
done

## end of file

-- 
                     Geek House Productions, Ltd.

  Providing Unix & Internet Contracting and Consulting,
  QA Testing, Technical Documentation, Systems Design & Implementation,
  General Programming, E-commerce, Web & Mail Services since 1998

Phone:   604-435-1205
Email:   djw at reactor-core.org
Address: 2459 E 41st Ave, Vancouver, BC  V5R2W2


-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/pgp-signature
Size: 797 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis/attachments/20020309/48271109/part-0001.pgp


More information about the Vorbis mailing list