Discussion in Freesound.org, here, is stagnated. You could do this with Audacity but their developer warned about that (apparently stupid idea to load the GUIs or something like that). Is there something like ImageMagick for sounds? I have a repository full of small music pieces (UX sounds etc) that I need to one consistent format, how can I do that?
Asked
Active
Viewed 105 times
4
-
I would search the web for a sound converter for your system. Whether you're on Linux, Windows or OS X, you'll probably going to find something. – May 14 '12 at 13:39
2 Answers
6
The following example will make a directory called outputdir and then re-encode all wav inputs in the current directory to mp3:
mkdir outputdir
for f in *.wav; do ffmpeg -i "$f" -c:a libmp3lame -q:a 4 outputdir/"${f%.wav}.mp3"; done
You can use a slightly modified command to convert multiple formats to MP3:
mkdir outputdir
for f in *.{wav,aiff,flac,m4a}; do ffmpeg -i "$f" \
-c:a libmp3lame -q:a 4 outputdir/"${f%.*}.mp3"
Use whatever file extensions you want in there, but remember that converting one from one lossy codec to another is a bad idea (so converting ogg vorbis to mp3 wouldn't work well).
llogan
- 336
- 2
- 5