Created
December 23, 2017 08:32
-
-
Save jack126guy/6a5ac6fc9e3fd183592ec23de8a9e4c9 to your computer and use it in GitHub Desktop.
Shell script to demonstrate generation loss in an audio file
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
#!/bin/sh | |
COUNT=0 | |
MAX=50 | |
SOURCE='source_file.flac' | |
FORMAT='genloss%03d.mp3' | |
FLAGS='-b:a 128k' | |
while [ $COUNT -lt $MAX ]; do | |
if [ $COUNT -eq 0 ]; then | |
PREV="$SOURCE" | |
else | |
PREV=`printf "$FORMAT" $COUNT` | |
fi | |
COUNT=$(($COUNT + 1)) | |
CUR=`printf "$FORMAT" $COUNT` | |
ffmpeg -i "$PREV" $FLAGS "$CUR" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment