From 1747f33c34e85fcbf161e4680404fdce2ee384f0 Mon Sep 17 00:00:00 2001 From: jules on spawn Date: Fri, 25 May 2018 15:56:35 +0200 Subject: if pitchshiftedfiles are not exactly 8 seconds remove them --- datasets/dataset.pl | 17 ++++++++++++----- export-all.pl | 0 results/xfade.sh | 4 ++++ 3 files changed, 16 insertions(+), 5 deletions(-) mode change 100644 => 100755 export-all.pl diff --git a/datasets/dataset.pl b/datasets/dataset.pl index cd068bf..568928c 100755 --- a/datasets/dataset.pl +++ b/datasets/dataset.pl @@ -3,8 +3,8 @@ use strict; use Getopt::Std; -our $opt_c; # normalize the file -our $opt_j; # jitter the pitch of each subsample by N rather than repitching big chunks +our $opt_c; # DON'T normalize the file +our $opt_j; # jitter the pitch of each subsample by N 1/100th semitones rather than repitching big chunks getopts('cj:'); print "<<<< DATASET >>>>\n"; @@ -78,9 +78,16 @@ sub process($) { next if /^\./; print "$i...\n" if ++$i % 100 == 0; my $fn = $_; - my $n = rand( 2 * $opt_j ) - $opt_j; - system 'sox', $name . '/' . $fn, $name . '/z_' . $fn, 'pitch', $n; - system 'rm', $name . '/' . $fn; + my $in_fn = $name . '/' . $fn; + my $out_fn = $name . '/z_' . $fn; + my $n = int rand( 2 * $opt_j ) - $opt_j; + system 'sox', $in_fn, $out_fn, 'pitch', $n; + my $rep = `soxi $name/z_$fn`; + if ($rep =~ /352800/) { + unlink $in_fn; + } else { + unlink $out_fn; + } } closedir $dh; } diff --git a/export-all.pl b/export-all.pl old mode 100644 new mode 100755 diff --git a/results/xfade.sh b/results/xfade.sh index 55d343d..accaae7 100755 --- a/results/xfade.sh +++ b/results/xfade.sh @@ -4,6 +4,10 @@ limit=10000 for file in `ls *.wav | sort -V` do + if [ "$file" = 'mix.wav' ] || [ "$file" = 'out.wav' ] + then + continue + fi i=$((i+1)) if [ $i -eq $limit ] then -- cgit v1.2.3-70-g09d2