aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-14 13:24:20 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-14 13:24:20 -0400
commitd195629ca94536e603f7ae4ec95180e1cd35fcfa (patch)
tree67ed050fbe93ea8ce120b3382b8fa45265032971
parent10d8fa5ca496d8377b56ba5a081d41fec4497324 (diff)
downloadsoxdial-d195629ca94536e603f7ae4ec95180e1cd35fcfa.tar.gz
soxdial: trim trailing silence.
-rwxr-xr-xsoxdial9
1 files 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;
}