Eduard Bloch wrote:
#include <hallo.h>
* Eugen Dedu [Thu, Sep 21 2006, 01:01:47PM]:
Hi,

In fact, I think users prefer to have info files about the CD. If they wish, they can remove them afterwards. So please remove -H from the "Looking for available tracks..." section.

I disagree, sorry. I prefer the policy of not leaving garbage behind,
especially if the user is not told about what is happening there. And I
doubt that they have much value unless CDDB information is stored
inside. But for that kind of usage, there are IIRC more sophisticated
scripts available.

And, after all, if the user wishes the data, she can run it manually
with -J and -H etc.pp.

Ok.

Also, I think it is better to have only one executable instead of two: cdda2ogg and cdda2mp3, the other being a simbolic link. There are only 3 or 4 lines different, I can send you a patch if you agree.

Patch is welcome and consolidation makes sense. I even though about
doing that myself but was too lazy ATM.

Here is cdda2ogg. cdda2mp3 should be a link to cdda2ogg. Do you agree with the patch?

snoopy:~$ diff -u /usr/bin/cdda2ogg cdda2ogg
--- /usr/bin/cdda2ogg   2006-09-06 19:43:04.000000000 +0200
+++ cdda2ogg 2006-09-21 17:53:29.000000000 +0200
@@ -1,16 +1,9 @@
 #! /bin/sh
-# Demo script for processing all audio tracks with a mp3 decoder
+# Script for processing all audio tracks with an ogg or mp3 decoder
 # based on a news article by Tom Kludy
 # This variant uses named pipes in order to save space.
-# There is another variant of this script, which uses temporary
-# wav files (see cdda2mp3.new).
 #
-# usage: cdda2ogg <name prefix for all ogg files>
-#
-# list_audio_tracks is a (symbolic) link to cdda2wav
-# and used to generate a list of audio track numbers and start
-# sectors, which in turn are used in a loop to spawn cdda2wav
-# and the post processor on a track by track basis.
+# usage: cdda2ogg <name prefix for all ogg/mp3 files>

 # specify the sampling program and its options
 # do not specify the track option here!
@@ -20,25 +13,30 @@
 # for normal use, comment out the next line
 #DEBUG='-d1'

+suffix=`basename $0 | cut -c6-`  # suffix: ogg or mp3
+
 # the post processor is fed through a pipe to avoid space waste
 # specify the post processing program and its options
-MP_CODER=${MP_CODER:-oggenc}
+if [ $suffix = "ogg" ]; then
+    MP_CODER=${MP_CODER:-oggenc}
+else
+    MP_CODER=${MP_CODER:-lame}
+fi
 MP_OPTIONS=${MP_OPTIONS:-''}

 export MP_CODER
 MP_CODER=$(which $MP_CODER 2>/dev/null)
 if [ ! -x "$MP_CODER" ] ; then
-   echo "Encoder not found. Install one first! (eg. vorbis-tools)"
+ echo "Encoder not found. Install one first! (eg. vorbis-tools or toolame)"
    exit 1
 fi

 CDDA_DEVICE=${CDDA_DEVICE:-/dev/cdrw}
-export CDDA_DEVICE

 FILEPREFIX=${1:-audiotrack}

-if [ -e /etc/default/cdda2ogg ]; then
-       . /etc/default/cdda2ogg
+if [ -e /etc/default/cdda2$suffix ]; then
+       . /etc/default/cdda2$suffix
 fi

 if [ -z "$LIST" ] ; then
@@ -54,11 +52,14 @@
 echo Cancel with Ctrl-C, watch out for error messages.

 for TRACK in $LIST ; do
-   NAME="`printf "%02d" $TRACK`-$FILEPREFIX.ogg"
+   NAME="`printf "%02d" $TRACK`-$FILEPREFIX.$suffix"
    echo
echo "############ Starting with Track Nr. $TRACK -> $NAME ############"
-  $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG - | \
-  $MP_CODER $MP_OPTIONS - > "$NAME"
+   if [ $suffix = "ogg" ]; then
+ $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG - | $MP_CODER $MP_OPTIONS - > "$NAME"
+   else
+ $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG - | $MP_CODER $MP_OPTIONS - "$NAME"
+   fi

   # check result code
   RES=$?
@@ -66,6 +67,4 @@
     echo File $NAME failed \(result $RES\). Aborted. >&2
     break
   fi
-  TRACK=`echo $(($TRACK+1))`
 done
-

Friendly,
Eugen Dedu


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to