PDA

View Full Version : [ubuntu] Converting wav to mp3 with lame. I don't get the basics...



kingdonerkebab
September 17th, 2009, 05:19 PM
Er, yeah. I've tried looking for the answer to this but I can't find it maybe because it's so basic that nobody's thought to post it anywhere, but there you go.

I've got some big fat .wav files on my computer taking up room and I want to convert them to 320kbps mp3s. The thing I don't know how to do is make lame find the files I want to convert.

This is what I've been trying:

lame --preset insane home/kingkebab/music/track1.wav track1.mp3

or even

lame --preset insane track1.wav track1.mp3

But obviously isn't working.

Say the files are in home/kingkebab/music/artist/album, how can I make it locate this album and convert them? And is there a way of converting a full album at once instead of individual files?

Thanks!

iansane
September 17th, 2009, 05:52 PM
Hope this isn't a silly question.

Are you putting a / in front of home for that absolute path?

/home/kingkebab/music/track1.wav track1.mp3

wildman4god
September 17th, 2009, 05:56 PM
a much easier way is to use an app called sound converter.

install throught add/remove, synaptic or cli with:

sudo apt-get install soundconverter

that should be much easier.

por100pre1
September 17th, 2009, 05:59 PM
Use Sound Converter.

Copy, paste and ENTER this command in Terminal (Applications> Accesories> Terminal):


sudo apt-get install soundconverter

EDIT:Too Late!!!

tgalati4
September 17th, 2009, 07:13 PM
lame will probably take ~/Music/track1.wav
~/ is a shortcut for your home directory. Of course you must respect case as well. You have "music" directory, but by default, Ubuntu comes with "Music" directory.

kingdonerkebab
September 18th, 2009, 09:27 PM
Thanks guys. I was being stupid and missing the "/".

The other thing I wanted to know was about how to batch convert a full album, or do I have to enter in the name of the song and it's location every time?

I'm sure I've seen some funky piece of code somewhere that could get this to happen on some forum somewhere, but now I can't find it.

I might try soundconverter. Will it convert to 320kbps? Although I kind of wanted to get it to work in lame as a matter of principle :)

CaptainMark
September 18th, 2009, 10:03 PM
Sound converter has a batch option and its about as easy to use as they come, i think you can select the bitrate in the preferences but its been a while since i used it

camaron1
September 18th, 2009, 10:59 PM
Thanks guys. I was being stupid and missing the "/".

The other thing I wanted to know was about how to batch convert a full album, or do I have to enter in the name of the song and it's location every time?

I'm sure I've seen some funky piece of code somewhere that could get this to happen on some forum somewhere, but now I can't find it.

I might try soundconverter. Will it convert to 320kbps? Although I kind of wanted to get it to work in lame as a matter of principle :)


You may want to have a look here: http://izanbardprince.wordpress.com/2009/07/28/soundconverter-on-linux-mutilates-the-mp3-files-it-creates/

kingdonerkebab
September 19th, 2009, 12:28 AM
Had a look at sound converter. Even with all the settings at maximum quality it only gives me a target quality of 256kbps.

tgalati4
September 19th, 2009, 01:55 AM
man lame

lame -b 320

This will do 320 kbps constant bitrate. If you have useful filenames, then you can probably use wildcards (*) in the filenames.

lame -b 320 ~/Music/Album 1/*.wav

See how that works.

rsambuca
September 19th, 2009, 02:20 AM
Had a look at sound converter. Even with all the settings at maximum quality it only gives me a target quality of 256kbps.

Sound Converter just uses lame to convert to mp3. Just edit the mp3 instructions to whatever you want in the "preferences" menu.

garyed
September 19th, 2009, 03:40 AM
I've never tried this with a whole album but I've done this with 3 or 4 .wav files at a time so it should work.
Go to a terminal & to the directory with the .wav files you want to convert.
Type this command & that should do it:

for i in *.wav; do lame -b 128 $i; done
You can change 128 to 320 but it depends on the codec of the wav file whether or not it will work. 128 usually works on anything.
All your wav files will remain intact & the new mp3 files will have the original names with .mp3 appended to the end.

Sometimes you don't have permissions so you need to be root if that happens. In that case put
sudo in front of the command.
Good luck