HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: aax on 2012-12-04 23:08:54

Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: aax on 2012-12-04 23:08:54
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?
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: kwanbis on 2012-12-05 00:43:43
I would do that with foobar2000.
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: aax on 2012-12-05 01:26:14
I know, but I'd prefer to do it without any software, just a batch script
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: julf on 2012-12-05 21:09:30
What OS?
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: J.Philippe on 2012-12-05 22:14:09
flac -d *.flac

for f in *.wav; do lame -V 0 "$f" "${f%.wav}.mp3"; done
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: aax on 2012-12-05 22:36:57
Win 7.

And how about keeping tags? I suppose I need metaflac for that?
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: J.Philippe on 2012-12-05 22:44:20
No clue. I use foobar.
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: yourlord on 2012-12-05 22:58:56
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.
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: greynol on 2012-12-06 00:00:29
http://www.hydrogenaudio.org/forums/index....mp;#entry601287 (http://www.hydrogenaudio.org/forums/index.php?showtopic=67541&st=0&p=601287&#entry601287)
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: aax on 2012-12-06 22:10:03
OK, I've found these FLAC Transcoder (http://www.simplefuels.com/tapergeek/flac-transcoder.htm) 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.
Title: Help me with a batch script for WAV and FLAC to MP3 conversion
Post by: aax on 2012-12-10 00:11:03
Is there a way to specify to write image as front cover when using --ti "file" switch?
By default it saves it as "other".