Sfoglia il codice sorgente

Fix loops; adjust tempo change

Joe Ceresini 3 anni fa
parent
commit
8954e98863
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 5 5
      powerhour.sh

+ 5 - 5
powerhour.sh

@@ -21,18 +21,18 @@ audio_len=$($FFPROBE -v error -show_entries format=duration -of default=noprint_
 max_start=$(expr $audio_len - $CLIP_LEN)
 
 # first make a bunch of 60s clips with random start positions
-for i in $(seq 0 59); do
+for i in {0..59}; do
   rand_start=$(($RANDOM % $max_start))
   outfile="clip-$i.wav"
   $FFMPEG -ss $rand_start -t 60 -i $file $outfile
 done
 
 # next loop over those clips and shrink them appropriately
-for i in $(seq 0 59); do
+for i in {1..59}; do
   outfile="clip-$i.wav"
   infile="_$outfile.tmp"
   mv $outfile $infile
-  tempo=$(eval printf 'atempo=1.1,%.0s' {1..$i} | sed 's/,$//')
+  tempo=$(eval printf 'atempo=1.01,%.0s' {0..$i} | sed 's/,$//')
   $FFMPEG -i $infile -filter:a "$tempo" -vn $outfile
   rm $infile
 done
@@ -40,8 +40,8 @@ done
 # stitch em together
 # Using a file here because i need to access it in docker
 >_concat
-for i in $(seq 0 59); do
-  echo "file clip-$i-adj.wav" >>_concat
+for i in {0..59}; do
+  echo "file clip-$i.wav" >>_concat
   [ "$sep" != "" ] && echo "file $sep" >>_concat
 done