Skip to main content

Topic: Help me with a batch script for WAV and FLAC to MP3 conversion (Read 3977 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • aax
  • [*]
Help me with a batch script for WAV and FLAC to MP3 conversion
I would like to have a batch script for converting wav and flac files to mp3 using preset lame switches, copy flac tags and put the resulting files in a folder within the original folder. I'd also like to be able to just drag a folder or file on top of that script to execute it.

Is that something that can be done? If it is, could someone at least make me an outline of such script?

  • kwanbis
  • [*][*][*][*][*]
  • Developer (Donating)
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #1
I would do that with foobar2000.

  • aax
  • [*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #2
I know, but I'd prefer to do it without any software, just a batch script
  • Last Edit: 04 December, 2012, 08:26:25 PM by aax

  • julf
  • [*][*][*][*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #3
What OS?

  • J.Philippe
  • [*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #4
flac -d *.flac

for f in *.wav; do lame -V 0 "$f" "${f%.wav}.mp3"; done

  • aax
  • [*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #5
Win 7.

And how about keeping tags? I suppose I need metaflac for that?

  • J.Philippe
  • [*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #6
No clue. I use foobar.

  • yourlord
  • [*][*][*][*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #7
I was going to say that little script wouldn't preserve tags.

Only thing I can think of really quick is use metaflac to read tags, parse and store them in variables, then use flac to decode and pipe to lame called with those tags defined on it's command line.

I could write that if I cared enough, but I rarely use mp3 and if I do I generally batch convert using soundconverter or soundkonverter.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #8
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • aax
  • [*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #9
OK, I've found these FLAC Transcoder scripts and edited them to work with latest lame and recommended compression settings and it works really well.
The only problem is that LAME just won't use UTF-16 encoding in tags even when I add "--id3v2-only --id3v2-utf16" as switches.
  • Last Edit: 06 December, 2012, 05:10:30 PM by aax

  • aax
  • [*]
Help me with a batch script for WAV and FLAC to MP3 conversion
Reply #10
Is there a way to specify to write image as front cover when using --ti "file" switch?
By default it saves it as "other".