Created
July 13, 2017 14:52
-
-
Save ktzar/7cfb2985370aa97a00b04c44608f706c to your computer and use it in GitHub Desktop.
Audio conversion tools
This file contains hidden or 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 | |
BITRATE=64 | |
OUTDIR="." | |
if [ "$1" != "" ]; then | |
BITRATE=$1 | |
fi | |
if [ "$2" != "" ]; then | |
OUTDIR=$2 | |
fi | |
echo "Encoding with bitrate ${BITRATE} in ${OUTDIR}" | |
for file in *.mp3 ; do | |
FILE=`basename "${file}" .mp3` | |
OUTFILE="$OUTDIR/$FILE.ogg" | |
avconv -i "$file" -f wav -map_metadata 0 - | opusenc --bitrate $BITRATE - "$OUTFILE" | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment