Greg's Tech blog

converting audio with ffmpeg

Monday 08 of April, 2019

Needed to convert a couple wma files to mp3 because their stream layout wouldn't play with subsonic without a special conversion command. This took care of it:

for file in *.wma; do ffmpeg -i "$file" -map 0:1? -b:a 320k -v 32 -f mp3 "/$(basename -s .wma "$file").mp3"; done   

The tricky part was using basename to cut off the extension so I could rename the file.