How to batch convert .wav to .mp3? (Solved)

Audio editors, music players, video players, burning software, etc.
Post Reply
Message
Author
User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

How to batch convert .wav to .mp3? (Solved)

#1 Post by LazY Puppy »

Hi.

Is there a program to convert collections (huge directories with files in it) of .wav files to .mp3 in batch mode etc.pp.?

Thanks
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#2 Post by Semme »

Hmm, Don could have yer # here.. Then again, could be SFR..

Actually, I know what you want and I've done it, or, got it somewhere.. :D

If they don't show in reasonable time, I've got it!

==

OK, it's gotta be dis..

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#3 Post by Pete »

Hi LazY Puppy

There may well be a pgm to do it, but you could also write a script
to iterate through a directory and convert each wav file to a mp3 using ffmpeg.

Things to note, I have not tested it thoroughly, the script assumes that at least one wav file exists in the directory.
To safeguard against this, look at the shopt command.

Change the directory in the script to suit your needs.
The mp3's will be created in the same directory.

Code: Select all

#!/bin/bash
FILES=/path/to/*.wav
for SourceFile in $FILES
do
  DestFile=`echo -n $SourceFile | head --bytes=-4`
  ffmpeg -i $SourceFile -codec:a libmp3lame -b:a 256k $DestFile.mp3
done
You can also change the bitrate of the mp3/s to something lower like 128k instead of 256k.
To "clean up" the screen, you can also send the text output of ffmpeg to dev/null.
Last edited by Pete on Sat 10 Sep 2016, 22:05, edited 1 time in total.

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#4 Post by LazY Puppy »

Oh my GOD!

probably I should consider to retire, as I do have don570's right-click function to convert directories of .wav to .mp3 included into one of my T.O.P.L.E.S.S. System SFS Modules by default - so it is existing in all my Puppy Systems. :lol: :roll:

Thanks for the replies.

Retirement... ...hhmmm... :wink:
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#5 Post by Semme »

You OLD :lol::wink: FART -- Don't retire, @ least, not yet! You're too young to stop contributing.. You old fart! :mrgreen:
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#6 Post by zigbert »

pMusic will do batch convertion of all files in the playqueue.
See menu Playqueue->Export

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#7 Post by LazY Puppy »

Semme wrote:You OLD :lol::wink: FART -- Don't retire, @ least, not yet! You're too young to stop contributing.. You old fart! :mrgreen:
:lol:
zigbert wrote:pMusic will do batch convertion of all files in the playqueue.
See menu Playqueue->Export
What is used as the backend for convertion?

I'm asking since I'm in tahr 32bit mostly. And this doesn't have ffmpeg installed. I seem to recall ffmpeg listed as a dependency in pMusic, no?

The pMusic is also not installed in tahr.

When did pMusic disappear from Puppy?
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#8 Post by zigbert »

LazY Puppy wrote:What is used as the backend for convertion?
ffmpeg
LazY Puppy wrote:When did pMusic disappear from Puppy?
pMusic is a part of Woof-CE, but it is up to the Puppy-builder what apps should be in and what should be out. Maybe the use of ffmpeg was the tipping point in Tahr. - Though both ffconvert and pBurn is included, so probably it just includes what 666philb finds usable. Sad for pMusic because it misses valuable testers, but after all, Puppy Tahr is his work.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#9 Post by don570 »

My right click utilities still work with new distros.

http://murga-linux.com/puppy/viewtopic.php?t=70759

I still use it to convert a folder of wav files to mp3.
It more convenient than pmusic.

_______________________________________

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#10 Post by LazY Puppy »

zigbert wrote:
LazY Puppy wrote:When did pMusic disappear from Puppy?
pMusic is a part of Woof-CE, but it is up to the Puppy-builder what apps should be in and what should be out. Maybe the use of ffmpeg was the tipping point in Tahr. - Though both ffconvert and pBurn is included, so probably it just includes what 666philb finds usable. Sad for pMusic because it misses valuable testers, but after all, Puppy Tahr is his work.
Ok.

I see gtkdialog 0.8.4 is also required. Tahr (which is a Woof CE built Puppy) has gtkdialog 0.8.3 installed. So probably this is another reason.

Since pMusic is part of Woof CE, I don't get the clue why Woof CE doesn't include gtkdialog 0.8.4 to be built into a Puppy. Otherwise it's useless to hold pMusic as a part of Woof CE. Wouldn't gtkdialog 0.8.4 make it easier for pMusic to return?

At least it would make it easier for the user to just download pMusic, install and playing songs in pMusic. Also would be nice to have a .sfs version with all the needed (or at least the basic) dependencies included, though.

Edit:

Checked Xenial 704 right now - gtkdialog 0.8.4 installed.
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#11 Post by zigbert »

Xenial also include ffmpeg, so pMusic should be only one click away :)

Post Reply