diff options
author | B. Watson <urchlay@slackware.uk> | 2024-04-14 13:24:20 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-04-14 13:24:20 -0400 |
commit | d195629ca94536e603f7ae4ec95180e1cd35fcfa (patch) | |
tree | 67ed050fbe93ea8ce120b3382b8fa45265032971 | |
parent | 10d8fa5ca496d8377b56ba5a081d41fec4497324 (diff) | |
download | soxdial-d195629ca94536e603f7ae4ec95180e1cd35fcfa.tar.gz |
soxdial: trim trailing silence.
-rwxr-xr-x | soxdial | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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; } |