Put all your .wav files (that you want to convert) into a folder and execute the following script from within this folder, make sure to make this script executable (chmod 777 wav2mp3.sh)
faad2 and lame
#!/bin/sh # name of this script: wav2mp3.sh # wav to mp3 for i in *.wav; do if [ -e "$i" ]; then file=`basename "$i" .wav` lame -h -b 192 "$i" "$file.mp3" fi doneDependencies
faad2 and lame
24 comments:
As is so often the case, here I am looking for a solution and I find it. The Linux world is the 'only' world to inhabit :)
Thank you and thank you to those who have influenced you.
Great work and many thanks.
Regards,
Patrick
I found this to be very helpful. All the search results I got for converting WAV files to MP3 in Linux were way too complicated -- I knew there'd be something similar. Thanks a bunch!
Very nice!
Awesome ... from googling to implementation, 2 minutes.
THANKS
thanks for the script
rmj
Thank you! This script really does the job. Works perfectly on my fedora 14-system.
Cheers, Tove
Would change it to allow for WAV as well as wav.
Works like a charm... Cheers and keep up the good scripting :)
chmod 777 is a evil, dont use!
use chmod +x and read the manual (man chmod)
Thanks a lot mate, always nice to find precisely what you are looking for in under a minute.
Online tool for conversion in AS3
convert mp3 to wav
Excellent. Excellent. Now that is just excellent. You know, seeing the script got me an idea - I am going to expand the script to rip all my audio CDs the moment I insert them, cos I do that a lot - and add it as an autoplay option.
Not entirely sure yet how that is done, the autoplay part, but it's worth finding out. Again, thanks for an amazingly neat script.
It works great, i had to install lame (small) though. Thanx
Should the line be
if [ -f "$i" ]; then
as -e tests if the file exists and-f tests if the file exists and is also a real file rather than a device, directory, block etc., ?
on UBUNTU use RIPPER X to convert all audio files ^-^
to easy
Thanks for the post
convert mp3 to wav
Cheers dude, works like a charm!
exactly what I was looking for, cheers!
Cheers !
Thanks for the post..
Here is online free mp3 to wav converter
convert mp3 to wav
When I execute this script (with some slight modifications) as written above...
for i in *wav; do
if [ -f "$i" ]; then
file='basename "$i" .wav'
lame -h -b 320 "$i" "$Output/$file.mp3"
fi
done
the output writes all files in the directory as:
basename"$i".wav.mp3
Because each file is written as basename"$i".wav.mp3, the result is that only 1 file is written to the output directory (the preceding file is overwritten every time).
I can amend the script slightly to remove the "basename" command:
for i in *wav; do
if [ -f "$i" ]; then
file="$i"
lame -h -b 320 "$i" "$Output/$file.mp3"
fi
done
to get a slightly better result:
FileName.wav.mp3
But the problem is that now I'm stuck with 2 extensions. Surely I'm not the only one who has encountered this problem! If anyone has run into this problem and found their way around it, would you please tell me how I can edit this script to remove .wav and replace with .mp3 upon conversion? Also, if I've done something wrong, please notify me.
Thanks in advance for your help.
Worked for me. Simple & effective. Thanks for the post.
Thanks for repositories, thanks for shell scripts, and thanks for awesome people like you who post exactly what we were looking for--no need to install bloatware.
very helpful. thanks.
Post a Comment