externalize filextension crap, new "cutToCD" for audio files

This commit is contained in:
gutmet 2020-10-13 15:27:47 +02:00
parent fca697ef86
commit 6665455fb8
4 changed files with 16 additions and 7 deletions

7
cutToCD Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
fullpath="$1"
source fileextensions
outfile="$dir/$filename""-79min.wav"
ffmpeg -t 01:19:00 -i "$1" -vn "$outfile"

View File

@ -6,10 +6,7 @@ if [ "$#" -ne 3 ]; then
fi fi
fullpath="$1" fullpath="$1"
dir=`dirname "$fullpath"` source fileextensions
filename=`basename "$fullpath"`
extension="${filename##*.}"
filename="${filename%.*}"
outfile="$dir/$filename""Cut.$extension" outfile="$dir/$filename""Cut.$extension"
echo "$outfile" echo "$outfile"

7
fileextensions Normal file
View File

@ -0,0 +1,7 @@
# specify $fullpath in your original script
# then source this one to get dir, filename and extension in separate variables
dir=`dirname "$fullpath"`
filename=`basename "$fullpath"`
extension="${filename##*.}"
filename="${filename%.*}"

View File

@ -6,9 +6,7 @@ if [ "$#" -ne 1 ]; then
fi fi
fullpath="$1" fullpath="$1"
dir=`dirname "$fullpath"` source fileextensions
filename=`basename "$fullpath"`
filename="${filename%.*}"
outfile="$dir/$filename""Shrunk.mp4" outfile="$dir/$filename""Shrunk.mp4"
echo "$outfile" echo "$outfile"