From 5371ded1b2267716980230fbe31fdb69d8fe7850 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 26 May 2016 23:17:15 +0200 Subject: CD-Ausgabe ergänzt nun ggf. den allerletzten Track MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sound-cutter.in | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sound-cutter.in b/sound-cutter.in index 2bdb880..26dd07b 100644 --- a/sound-cutter.in +++ b/sound-cutter.in @@ -334,9 +334,22 @@ do trimcmd="${trimcmd}trim 0s =${outTimes[${i}]}s : " ${newFile[${i}]} && trimcmd="${trimcmd}newfile : " done +trimcmd="${trimcmd%: }" [ ${outRate} -ne ${inRate} ] && remixcmd="${remixcmd} rate -v ${outRate}" -${cdAusrichten} && output="-b 16 ${output}" +if ${cdAusrichten} +then + output="-b 16 ${output}" + gesZeit=$[ \ + $(timetosample "${outRate}" $(echo "${firstline}" | awk '{print $2}' | tr '=' ' ')) \ + - $(timetosample "${outRate}" $(echo "${firstline}" | awk '{print $1}' )) \ + ] + gesZeit=$(bc <<< "((${gesZeit}-1) / 588 + 1)*588") + remixcmd="${remixcmd} trim 0 =${gesZeit}s" + extraIn=" -r ${inRate} -c ${#inputs[@]} -n" +else + extraIn="" +fi if ! ${noGain} then @@ -347,7 +360,7 @@ fi echo sox -M "${inputs[@]}" -p trim ${firstline} echo sox -t sox - -p ${repcmd} echo sox -t sox - -p ${trackmodcmd} -echo sox -t sox - -p ${splicecmd} ${remixcmd} +echo sox -t sox - ${extraIn} -p ${splicecmd} ${remixcmd} echo sox -t sox - ${output} ${trimcmd} if ! ${dummy} @@ -355,6 +368,6 @@ then sox -M "${inputs[@]}" -p trim ${firstline}| \ sox -t sox - -p ${repcmd} | \ sox -t sox - -p ${trackmodcmd} | \ - sox -t sox - -p ${splicecmd} ${remixcmd} | \ + sox -t sox - ${extraIn} -p ${splicecmd} ${remixcmd} | \ sox -t sox - ${output} ${trimcmd} fi -- cgit v1.2.3-54-g00ecf