[SLUG] Re: wma to mp3 (fwd)

From: Eben King (eben01@verizon.net)
Date: Sun Jul 13 2008 - 17:42:02 EDT


----- Original Message ----
From: Eben King <eben01@verizon.net>
To: Jonathan Brown <jbssfl@yahoo.com>
Sent: Saturday, July 12, 2008 12:55:55 AM
Subject: Re: wma to mp3

On Fri, 11 Jul 2008, Jonathan Brown wrote:

> Perl Audio Converter
>
> http://pacpl.sourceforge.net/
>
> or try the bash script in this forum: (you need mplayer and lame)
>
> http://ubuntuforums.org/showthread.php?t=37793

I modified it a bit, to make it faster. Less pretty (in fact some graphical
outputs stomp on each other), but around twice as fast. BTW, do you know
how to take zenity syntax and convert it to some similar text-based app?

,--
| #! /bin/sh
| # wma to mp3 script by mtron, modified by eben
| tempfile="/tmp/$$.${0##*/}"
|
| zenity --info \
| --text="this script converts all wma files in the current folder
| to mp3s and puts them in the folder output
|
| all lame command line options can be set in the next step.
|
| usage:
| lame -m s: for stereo mp3 output
| lame -m s V 3-4-5: for stereo mp3 output with VBR"
|
| # Dialog box to choose output quality
| LAME="$(zenity --list --title="Choose mp3 output quality" --radiolist --column="Check" --column="Quality (editable)" --editable "" "lame -m s" "" "lame -m s -V 3" "" "lame -m s -V 4" "" "lame -m s -V 5")"
|
| if [ "z$LAME" = z ]; then
| zenity --error --text="mp3 output quality not defined or no wma file found
|
| usage:
| lame -m s: for stereo mp3 output
| lame -m s V 3-4-5: for stereo mp3 output with VBR
|
| type: lame --longhelp
| for all command line options "
| exit 1
| fi
|
| cat << EOF > "$tempfile"
| #! /bin/sh
| cat "$tempfile"
| while [ \$# -gt 0 ] ; do
| file="\$1"
| basename="\${file%.*}"
| mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader:file="\${basename}.wav" "\$file" \\
| && $LAME "\${basename}.wav" -o "\${basename}.mp3"
| shift
| done
| rm "\${basename}.wav"
| EOF
| chmod a+x "$tempfile"
|
| #Rip with Mplayer | encode with LAME
| find . -maxdepth 1 -iname \*.wma -print0 | \
| xargs -0 -P 0 -n 1 "$tempfile"
|
| rm "$tempfile"
'--

> (sending to your email because for some reason I cant post to slug)

Do you mind if I post this to SLUG?

-----------------------------

Sure please post it to SLUG :)

and about the zenity conversion, I have no idea.. I don't use gnome or
nautilus, just awesomewm and fluxbox. And you know WAY more about
script-writing than I, I just know how to find stuff. ;-)

-- 
-eben      QebWenE01R@vTerYizUonI.nOetP      http://royalty.mine.nu:81
AQUARIUS:  There's travel in your future when your tongue freezes to the
back of a speeding bus.  Fill the void in your pathetic life by playing
Whack-a-Mole 17 hours a day.  -- Weird Al, _Your Horoscope for Today_

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:12:16 EDT