Skip to content

Instantly share code, notes, and snippets.

@Eddy-Barraud
Last active May 16, 2018 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eddy-Barraud/4d8da6226da82c9eab3f16d63c14ffe9 to your computer and use it in GitHub Desktop.
Save Eddy-Barraud/4d8da6226da82c9eab3f16d63c14ffe9 to your computer and use it in GitHub Desktop.
Convert every audio files inside the current directory to mp3
#!/bin/bash
find . -regex ".*\.\(opus\|ogg\|m4a\)" -print0 |
while IFS= read -r -d $'\0' filename; do
echo $filename
name="${filename%.*}"
< /dev/null ffmpeg -nostats -loglevel 0 -n -i "$filename" -b:a 0 -codec:a libmp3lame -vn "./$name.mp3"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment