Skip to content

Instantly share code, notes, and snippets.

@jack126guy
Created December 23, 2017 08:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Shell script to demonstrate generation loss in an audio file
#!/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