Created
October 20, 2017 18:44
-
-
Save pbojinov/cf8ad1bcf72a96dc83080a06d3e4e902 to your computer and use it in GitHub Desktop.
shell script to convert all wav files in the current working directory to mp3 files using ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILES=*.wav | |
for f in $FILES | |
do | |
# echo "Processing ${f/.wav/.mp3} file..." | |
echo "Processing $f file..." | |
ffmpeg -i "$f" -codec:a libmp3lame -qscale:a 0 "${f/.wav/.mp3}" | |
# take action on each file. $f store current file name | |
# cat $f | |
done | |
# Source: | |
# file looping - https://www.cyberciti.biz/faq/bash-loop-over-file/ | |
# string manipulation - http://www.tldp.org/LDP/abs/html/string-manipulation.html | |
# ffmpeg mp3 encoding guide - https://trac.ffmpeg.org/wiki/Encode/MP3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment