[ale] MP3-to-OggVorbis for GNOME (Was: Re: [Slightly OT] Help with a quick shell script?)

fd0man™—The Magical Floppy Man fd0man at gmail.com
Wed Aug 16 11:05:40 EDT 2006


On Wed, 2006-08-16 at 10:46 -0400, Charles Shapiro wrote:

> Sure np. BTW "IFS=\0x10" also works and might be a little easier to
> maintain -- depending on your audience.
> 
> -- CHS
> 

Just myself and my girlfriend, and any other interested parties.

Here is the final version that I am going with for now.  I may have to
make some changes to it later, but it works for my needs now.  I will
include it here if anyone wants it.  I don?t recommend doing more then 2
- 4 files at once with it, though, because it runs each one in a
terminal for the time being?and GNOME Terminal does not seem to have a
--wait option to wait for its children to die and run them sequentially.
*shrugs*  (I rather like seeing the work being done?)  It requires
mpg123 (or mpg321) and oggenc to function properly.

    ? Mike


#!/bin/bash
#

IFS="
"

for mp3file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
  do

   echo "Processing file ${mp3file}?"
   file "$mp3file"
   if [ $? -eq 0 ];
    then
     NewMusicFileName=`echo $mp3file | sed 's/\.mp3/\.ogg/g;'`
     gnome-terminal -t "Encoding $mp3file to $NewMusicFileName" -x sh -c "mpg123 -w - \"$mp3file\" | oggenc - -o \"$NewMusicFileName\""
   fi
  done


--
The fd0man??The Magical Floppy Man! (fd0man at gmail.com) 
"One world, one web, one program"  ?Microsoft promotional ad 
"Ein Volk, ein Reich, ein Fuehrer"  ?Adolf Hitler 
-------------- next part --------------
An HTML attachment was scrubbed...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part




More information about the Ale mailing list