Skip to content

Instantly share code, notes, and snippets.

@squio
Created April 16, 2023 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squio/bc8e893e2d109321f37640649d09ece5 to your computer and use it in GitHub Desktop.
Save squio/bc8e893e2d109321f37640649d09ece5 to your computer and use it in GitHub Desktop.
convert any file containing an audio stream to MP3
#!/bin/sh
# convert any file containing an audio stream to MP3
while [ -s "$1" ]
do
FILE="$1"
BASE=${FILE%.*}
ffmpeg -i "$FILE" -ab 128k -ac 2 -codec:a libmp3lame "${BASE}.mp3"
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment