Skip to content

Commit

Permalink
add option to skip questions on bash version in downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
tomich committed May 20, 2024
1 parent d4923e4 commit 90ac320
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions cook/powersfx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,101 @@ ffm() {
fi
}

skipper() {
MULTI=""
FILTER=""
LF="anull"
FFORMAT="ipod"
CODEC="aac"
EXT="m4a"
c=0
INFODATE=$(grep 'Start time:' info.txt |awk -F'T' '{print $1}'|awk -F':' '{print $2}'| xargs)
BASENAME="bigotes"
for i in *[0-9].flac
do
MULTI="$MULTI -i $i"
FILTER="$FILTER"'['"$c"':a]'"$LF"'[aud'"$c"'];'
c=$((c+1))
done
c=0
for i in *[0-9].flac
do
FILTER="$FILTER"'[aud'"$c"']'
c=$((c+1))
done

FILTER="$FILTER"'amix='"$c"','"$LF"'[aud]'

ffm $MULTI -filter_complex "$FILTER" -map '[aud]' -c:a "$CODEC" -f "$FFORMAT" "${ODIR}$INFODATE-$BASENAME-full.$EXT" || exit 1

if [ -e *BigoteMusic* ]
then
echo "Existe bigote Music"
MULTI=""
FILTER=""
LF="anull"
FFORMAT="ipod"
CODEC="aac"
EXT="m4a"
c=0
for i in *[0-9].flac
do
case $i in
*BigoteMusic*) continue;;
esac
MULTI="$MULTI -i $i"
FILTER="$FILTER"'['"$c"':a]'"$LF"'[aud'"$c"'];'
c=$((c+1))
done
c=0
for i in *[0-9].flac
do
case $i in
*BigoteMusic*) continue;;
esac
FILTER="$FILTER"'[aud'"$c"']'
c=$((c+1))
done

FILTER="$FILTER"'amix='"$c"','"$LF"'[aud]'

ffm $MULTI -filter_complex "$FILTER" -map '[aud]' -c:a "$CODEC" -f "$FFORMAT" "${ODIR}$INFODATE-$BASENAME-nomusic.$EXT" || exit 1

else
cp "${ODIR}$INFODATE-$BASENAME-full.$EXT" "${ODIR}$INFODATE-$BASENAME-nomusic.$EXT"
echo "No Music Bot. Files are the same"
fi

printf 'Cleaning...\n'

mkdir src
mv info.txt raw.dat src/

for i in *[0-9].flac
do
mv "$i" src/
done

printf 'Done!\n'
exit
}


printf 'This is the Craig audio processor. License information is in this script file.\n\n'

read -p '
Want the quick version? ' SKIPPY
MIX=`yesno "$SKIPPY" n`

if [ "$SKIPPY" = "y" ]
then
skipper
fi

read -p '
Want the quick version? ' SKIPPY
MIX=`yesno "$SKIPPY" n`

printf 'Please choose an output format:\n [F]LAC\n [A]udacity project\n [w]av\n [M]PEG-4 AAC (M4A)\n A[L]AC\n'
read -p '? ' FORMAT
ODIR=""
Expand Down

0 comments on commit 90ac320

Please sign in to comment.