quick bash script to convert flac to mp3
I was wondering if someone could give me a hand at writing a quick bash script to convert some .flac's to .mp3's so I can play them on my palm pilot. Right now all I have is:
Code:
flac -sdc $1 | lame - $2 Ultimately, I would like it to compose the file name from the previous file and the two top directories because my file structure is like so: artist/album/songs.flac, so the finished file would look like: artist-album-song.mp3 If I wasn't so busy with school I would read the bash coding how-to, but for now if someone could get my started that would be great. I also think this would benefit others, because of right now it seems to be sort of a pain in the ass to convert flac's to mp3's. Hell, I had to dig outside the debian repositories just to install lame. |
Re: quick bash script to convert flac to mp3
Quote:
Code:
#!/bin/sh Quote:
Quote:
|
Very cool, thank you very much
|
Quirk ;-)
This didn't work for me.
Using: Code:
$ bash --version Code:
`*.flac` This works perfectly for the current folder full of flac files, which will be copy-converted to file.mp3 instead. :) Code:
#!/bin/sh Thanks for the initial script! Note the extra arguments to the lame encoder. They are just for better conversion and slightly better quality. It just uses the best (slowest) algorithms and goes for a 192kbps VBR MP3. The mod is also set to Stereo (not Joint Stereo) for personal reasons; you can remove the -ms flag if you want to. My main target for this conversion was to play my files on a car FM MP3 player. |
Cool script Worksman ... Thanks!
:) |
Quote:
|
FWIW, one tool can be used for conversion instead of two: flac + lame - as simple as
ecasound -i file.flac -o file.mp3 . |
I doubt that is as flexible as using the two tools option.
Besides, I could go as far as to say that everyone prefers lame for their mp3 encoding needs. :) No bashing intended. |
Code:
#!/bin/sh Code:
#!/bin/sh |
All times are GMT -5. The time now is 02:19 AM. |