Skip to content

Instantly share code, notes, and snippets.

@cosimo
Created March 22, 2019 16:48
Show Gist options
  • Save cosimo/27492b76c411b148c6095bf1ef456651 to your computer and use it in GitHub Desktop.
Save cosimo/27492b76c411b148c6095bf1ef456651 to your computer and use it in GitHub Desktop.
Convert any MP3 to the format required by Amazon for Alexa audio tags
#!/bin/bash
INFILE="$1"
OUTFILE="$2"
which ffmpeg > /dev/null || {
echo "You need ffmpeg to convert audio files to Alexa MP3 format"
exit 1
}
if [ -n "$INFILE" -a -n "$OUTFILE" ]; then
ffmpeg -i "$INFILE" -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 "$OUTFILE"
else
echo "Usage: $0 <infile> <outfile>"
exit 2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment