Last active
February 20, 2019 03:16
-
-
Save coreymwamba/4952d7c937e6dabbbfb0e6cb6acc2379 to your computer and use it in GitHub Desktop.
Bash, inotify, FFMpeg script to convert audio files to a desired format by placing it in a folder. The example below is for Ogg Vorbis; change it to whatever you want. Then set the script to autostart (in DE or WM).
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
convert_ogg() { | |
ffmpeg -hide_banner -nostats -loglevel panic -i ~/audio/convert_to_ogg/$file -vn -b:a 320k ~/audio/convert_to_ogg/${file%.*}.flac & | |
echo "converting $file" | |
} | |
while true; do | |
inotifywait -m ~/audio/convert_to_ogg -e create -e moved_to | while read path action file; do | |
if [ ${file##*.} != "ogg" ]; then | |
convert_ogg | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment