summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-12-01 11:10:32 +0100
committerErich Eckner <git@eckner.net>2016-12-01 11:10:32 +0100
commita125bdde52461839e42b3abae07a88f776563547 (patch)
tree26faced5b3eead50011b0d6cd2dfeef0750b12ee
parent49aa8f944fd218370a1e84d8b9a4283f99e1dfd0 (diff)
downloadsound-cutter-a125bdde52461839e42b3abae07a88f776563547.tar.xz
--temp und --reject neu
-rw-r--r--sound-cutter.in55
1 files changed, 44 insertions, 11 deletions
diff --git a/sound-cutter.in b/sound-cutter.in
index 526fb07..666e32f 100644
--- a/sound-cutter.in
+++ b/sound-cutter.in
@@ -13,7 +13,11 @@ verwendung() {
>&2 echo ' -n, --dummy nur auszuführenden Befehl anzeigen und nichts tun'
>&2 echo ' -o, --output=outputDatei Zieldatei'
>&2 echo ' -p, --points=pointsDatei Punktedatei'
+ >&2 echo ' -r, --reject=Kanal,Frequenz,Breite,Harmonische'
+ >&2 echo ' blocke in Kanal Frequenz, Frequenz*2 ...'
+ >&2 echo ' Frequenz*Harmonische, jeweils mit Breite (-3dB)'
>&2 echo ' -s, --sampleRate=Rate alternative Samplerate zum Abspeichern'
+ >&2 echo ' -t, --temp=tempDir alternatives temporäres Verzeichnis für sox'
>&2 echo \
'#HELPTEXT# #'
[ -z "$1" ] && exit 1 || exit $1
@@ -38,7 +42,7 @@ timetosample() {
me="$(readlink -f "$0")"
eval set -- "$(
- getopt -o 1acfi:no:p:s: \
+ getopt -o 1acfi:no:p:r:s:t: \
--long noGain \
--long ausfuehrlich \
--long cd \
@@ -48,7 +52,9 @@ eval set -- "$(
--long dummy \
--long output: \
--long points: \
+ --long reject: \
--long sampleRate: \
+ --long tempDir: \
--long version \
-n "$(basename "$0")" -- "$@" || \
echo verwendung
@@ -96,11 +102,30 @@ while true; do
[ -n "${points}" ] && echo 'Ich kann nur eine Point-Datei-Option verstehen.' && verwendung
points="$1"
;;
+ -r|--reject)
+ shift
+ tmp="$1"
+ kanal="${tmp%%,*}"
+ tmp="${tmp#*,}"
+ freq="${tmp%%,*}"
+ tmp="${tmp#*,}"
+ breite="${tmp%%,*}"
+ maxn="${tmp#*,}"
+ for ((i=1; i<=$maxn; i++))
+ do
+ rejects[${kanal}]="${rejects[${kanal}]} bandreject $[${i}*${freq}] ${breite}"
+ done
+ ;;
-s|--sampleRate)
shift
[ -n "${outRate}" ] && echo 'Ich kann nur eine Samplerate-Option verstehen.' && verwendung
outRate="$1"
;;
+ -t|--tempDir)
+ shift
+ [ -n "${tempDir}" ] && echo 'Ich kann nur ein temporäres Verzeichnis verstehen.' && verwendung
+ tempDir="$1"
+ ;;
--version)
>&2 echo '#VERSION#'
exit 0
@@ -144,6 +169,8 @@ echo "${points}" | grep -q "\s" && \
>&2 echo "Bitte keine Leerzeichen im points-Dateinamen!" && \
exit 1
+[ -n "${tempDir}" ] && tempDir="--temp ${tempDir}"
+
if [ -e "${output}" ]
then
if ${force}
@@ -367,17 +394,23 @@ then
remixcmd="${remixcmd} gain -n"
fi
-echo sox -M "${inputs[@]}" -p trim ${firstline}
-echo sox -t sox - -p ${repcmd}
-echo sox -t sox - -p ${trackmodcmd}
-echo sox -t sox - ${extraIn} -p ${splicecmd} ${remixcmd}
-echo sox -t sox - ${output} ${trimcmd}
+for ((i=0; i<=${#inputs[@]}; i++))
+do
+ [ -z "${rejects[${i}]}" ] && continue
+ inputs[${i}]="|sox ${inputs[${i}]} -p${rejects[${i}]}"
+done
+
+echo sox ${tempDir} -M "${inputs[@]}" -p trim ${firstline}
+echo sox ${tempDir} -t sox - -p ${repcmd}
+echo sox ${tempDir} -t sox - -p ${trackmodcmd}
+echo sox ${tempDir} -t sox - ${extraIn} -p ${splicecmd} ${remixcmd}
+echo sox ${tempDir} -t sox - ${output} ${trimcmd}
if ! ${dummy}
then
- sox -M "${inputs[@]}" -p trim ${firstline}| \
- sox -t sox - -p ${repcmd} | \
- sox -t sox - -p ${trackmodcmd} | \
- sox -t sox - ${extraIn} -p ${splicecmd} ${remixcmd} | \
- sox -t sox - ${output} ${trimcmd}
+ sox ${tempDir} -M "${inputs[@]}" -p trim ${firstline}| \
+ sox ${tempDir} -t sox - -p ${repcmd} | \
+ sox ${tempDir} -t sox - -p ${trackmodcmd} | \
+ sox ${tempDir} -t sox - ${extraIn} -p ${splicecmd} ${remixcmd} | \
+ sox ${tempDir} -t sox - ${output} ${trimcmd}
fi