From d195629ca94536e603f7ae4ec95180e1cd35fcfa Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 14 Apr 2024 13:24:20 -0400 Subject: soxdial: trim trailing silence. --- soxdial | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/soxdial b/soxdial index f226847..99f351b 100755 --- a/soxdial +++ b/soxdial @@ -557,7 +557,9 @@ sub make_sox_cmd { $remix = "remix 1v0 1"; } - my $cmd = "$SOX -traw -b$bits $encoding -r$rate -c1 - $output $ch $remix"; + # the reverse/silence stuff trims trailing silence. we don't trim leading silence. + my $cmd = "$SOX -traw -b$bits $encoding -r$rate -c1 - " . + "$output $ch $remix reverse silence 1 0 0 reverse"; my $subcmds = join(" ; ", @sox_subcmds); return "( " . $subcmds . " ) | " . $cmd; } @@ -802,10 +804,7 @@ for ($argc = 0; $argc < @ARGV; $argc++) { } if(@freqs1) { push @sox_subcmds, make_sox_subcmd($time_override); - if($argc < $#ARGV) { - push @sox_subcmds, silence_subcmd(randomize($intertime)) - } - warn "argc $argc, \$\#ARGV " . $#ARGV . "\n"; + push @sox_subcmds, silence_subcmd(randomize($intertime)); } else { warn "$SELF: no valid digits in dial string.\n" if $verbose; } -- cgit v1.2.3