RE: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-23 Thread Richard Heycock

___

Note: This e-mail is subject to the disclaimer contained at the bottom of this 
message.
___


 On Tue, 2008-01-22 at 01:52 +1100, Sam Gentle wrote:
  Oh, and as always, man find will bring great enlightenment and 
  happiness.
 
 Don't use 'man find' - 'info find' is better.

info is evil.

rgh

 --
 Sonia Hamilton
 http://SoniaHamilton.wordpress.com
 mobile in Mexico: +52-664-165-6914 (sms's preferred) celular 
 en México: +52-664-165-6914 (prefiero mensajes cortos)
 
 
 
 -- 
 SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
 Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
 

___

The information transmitted in this message and its attachments (if any) is 
intended 
only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance 
upon this information, by persons or entities other than the intended recipient 
is 
prohibited.

If you have received this in error, please contact the sender and delete this 
e-mail 
and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or 
distribute 
the information contained in this e-mail and any attached files, with the 
permission 
of the sender.

This message has been scanned for viruses with Symantec Scan Engine and cleared 
by 
MailMarshal.
___
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


RE: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-23 Thread Sonia Hamilton
On Tue, 2008-01-22 at 09:52 +1100, Richard Heycock wrote:
  Don't use 'man find' - 'info find' is better.
 
 info is evil.

Notice I said 'better' not 'best' :-) 

I too find info a PITA (and even more of a PITA to teach to noobs) and
will have a play with the suggested pinfo.

-- 
Sonia Hamilton
http://SoniaHamilton.wordpress.com

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-22 Thread Richard Heycock
Excerpts from Kristian Erik Hermansen's message of Tue Jan 22 05:24:39 +1100 
2008:
 On Jan 21, 2008 5:59 AM, Daryl Thompson
 [EMAIL PROTECTED] wrote:
  I have 287Gb of my music still on an external HD in Windows Wma format
  in multiply directory's under a top directory of wma
  i wish to mass convert these files and do a little tidy up on them
  I have 3 main goals to achaive
 
 Have you considered OGG instead of MP3?  Check out dir2ogg in Ubuntu if so...
 $ sudo aptitude install dir2ogg
 $ dir2ogg -d -r -f -g -v /path/to/my/music

Umm, that's worth knowing about.

rgh

  1. Converting the wma to mp3
  2. Removing the wma after converting
 
 dir2ogg can help you .. see above
 
  3. removing the old desktop.ini files in these directory
 
 Another fun way (be careful)...
 find /path/to/my/music -name desktop.ini | while read line; do rm -i
 $line; done

-- 
You're worried criminals will continue to penetrate into cyberspace, and
I'm worried complexity, poor design and mismanagement will be there to meet
them - Marcus Ranum
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-21 Thread Sam Gentle
On Jan 22, 2008 12:59 AM, Daryl Thompson
[EMAIL PROTECTED] wrote:
 Hi

 I have 287Gb of my music still on an external HD in Windows Wma format
 in multiply directory's under a top directory of wma
 i wish to mass convert these files and do a little tidy up on them
 I have 3 main goals to achaive

 1. Converting the wma to mp3
 2. Removing the wma after converting
 3. removing the old desktop.ini files in these directory

There's an awfully nifty utility called find that you can use
whenever you need to interact with directory trees recursively.

I'll give you an example for your first problem, and the rest should
seem fairly obvious from there:

find -type f -iname '*.wma' -exec wma2mp3 {} \;

Which means find anything in this directory tree that's a file whose
name matches '*.wma' and then execute 'wma2mp3 that file'.

Remember, with great power comes great responsibility! Before you run
any find commands you should first make sure you're doing what you
think you're doing. Especially don't trust find commands given to you
by some random guy from the internet.

Changing -exec blah to -exec echo blah will show you what command
you're about to run on lots and lots of files. You may even want to
copy-paste one of the lines of echo output to your terminal to dry-run
it on just one file.

Don't be too proud to double-check - I'm sure everyone here has a
great story or two about wiping their home directory.

Oh, and as always, man find will bring great enlightenment and happiness.

Sam
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-21 Thread Kristian Erik Hermansen
On Jan 21, 2008 5:59 AM, Daryl Thompson
[EMAIL PROTECTED] wrote:
 I have 287Gb of my music still on an external HD in Windows Wma format
 in multiply directory's under a top directory of wma
 i wish to mass convert these files and do a little tidy up on them
 I have 3 main goals to achaive

Have you considered OGG instead of MP3?  Check out dir2ogg in Ubuntu if so...
$ sudo aptitude install dir2ogg
$ dir2ogg -d -r -f -g -v /path/to/my/music

 1. Converting the wma to mp3
 2. Removing the wma after converting

dir2ogg can help you .. see above

 3. removing the old desktop.ini files in these directory

Another fun way (be careful)...
find /path/to/my/music -name desktop.ini | while read line; do rm -i
$line; done
-- 
Kristian Erik Hermansen
Know something about everything and everything about something.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-21 Thread Alex Samad
On Tue, Jan 22, 2008 at 01:52:11AM +1100, Sam Gentle wrote:
 On Jan 22, 2008 12:59 AM, Daryl Thompson
 [EMAIL PROTECTED] wrote:
  Hi
 
  I have 287Gb of my music still on an external HD in Windows Wma format
  in multiply directory's under a top directory of wma
  i wish to mass convert these files and do a little tidy up on them
  I have 3 main goals to achaive
 
  1. Converting the wma to mp3
  2. Removing the wma after converting
  3. removing the old desktop.ini files in these directory
 
 There's an awfully nifty utility called find that you can use
 whenever you need to interact with directory trees recursively.
 
 I'll give you an example for your first problem, and the rest should
 seem fairly obvious from there:
 
 find -type f -iname '*.wma' -exec wma2mp3 {} \;

Can I suggest to quote the {} just in case

 find -type f -iname '*.wma' -exec wma2mp3 {} \;


 
 Which means find anything in this directory tree that's a file whose
 name matches '*.wma' and then execute 'wma2mp3 that file'.
 
 Remember, with great power comes great responsibility! Before you run
 any find commands you should first make sure you're doing what you
 think you're doing. Especially don't trust find commands given to you
 by some random guy from the internet.
 
 Changing -exec blah to -exec echo blah will show you what command
 you're about to run on lots and lots of files. You may even want to
 copy-paste one of the lines of echo output to your terminal to dry-run
 it on just one file.
 
 Don't be too proud to double-check - I'm sure everyone here has a
 great story or two about wiping their home directory.
 
 Oh, and as always, man find will bring great enlightenment and happiness.
 
 Sam
 -- 
 SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
 Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
 

-- 
Earlier today, the Libyan government released Fathi Jahmi. She's a local 
government official who was imprisoned in 2002 for advocating free speech and 
democracy.

- George W. Bush
03/12/2004
citing Jahmi, who is a man, in a speech paying tribute to women reformers 
during International Women's Week, Washington, D.C.


signature.asc
Description: Digital signature
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-21 Thread Sonia Hamilton
On Tue, 2008-01-22 at 01:52 +1100, Sam Gentle wrote:
 Oh, and as always, man find will bring great enlightenment and
 happiness.

Don't use 'man find' - 'info find' is better.

-- 
Sonia Hamilton
http://SoniaHamilton.wordpress.com
mobile in Mexico: +52-664-165-6914 (sms's preferred)
celular en México: +52-664-165-6914 (prefiero mensajes cortos)



-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-21 Thread Erik de Castro Lopo
Sonia Hamilton wrote:

 On Tue, 2008-01-22 at 01:52 +1100, Sam Gentle wrote:
  Oh, and as always, man find will bring great enlightenment and
  happiness.
 
 Don't use 'man find' - 'info find' is better.

Except that 'info' is such a horrible info reader. You might
want to try pinfo instead:

apt-get install pinfo
yum install pinfo

and then:

pinfo find

Erik
-- 
-
Erik de Castro Lopo
-
Perl  : executable line noise
Python: executable pseudo-code
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-21 Thread Jeremy Portzer

Sonia Hamilton wrote:

On Tue, 2008-01-22 at 01:52 +1100, Sam Gentle wrote:

Oh, and as always, man find will bring great enlightenment and
happiness.


Don't use 'man find' - 'info find' is better.


And if you don't like the emacs-y navigation/keybindings of info - 
checkout the pinfo client that accesses the same information, but with 
more standard PC keybindings - e.g. the pgup, pgdown, and arrow keys 
actually work as you might expect.


Sometimes pinfo isn't installed by default, but it's provided in most 
distributions.


--Jeremy
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mass converting Gigabites of wma to mp3

2008-01-21 Thread Rick Welykochy

Daryl Thompson wrote:



#
# Move the conversion process into a function that can
# be called.
# The  makes it so each step must be successful before


No, the  will not work as written. It must be used as a conjunction
on one command line, as in the following example:

mplayer blah  lame goop



# the next step will be done.
#

function wma2mp3 () {
  if [ ! -f $1 ]; then
 echo File $1 not found!
  else
 mplayer -ao pcm:file=${1%%.[Ww][Mm][Aa]}.wav $1 
 lame -h -b 192 ${1%%.[Ww][Mm][Aa]}.wav ${1%%.[Ww][Mm][Aa]}.mp3



The above  will not work as intended. Rather, you will see an error:

-bash: syntax error near unexpected token `'



 rm -f ${1%%.[Ww][Mm][Aa]}.wav ||
 echo There was a problem with the conversion process!
  fi
}



HTH

cheers
rick


p.s. as other posters have pointed out, find is your friend



--
_
Rick Welykochy || Praxis Services

Once a new technology starts rolling, if you're not part of the
steamroller, you're part of the road.
 -- Stewart Brand
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html