aboutsummaryrefslogtreecommitdiff
path: root/soxdial
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-10 15:03:26 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-10 15:03:26 -0400
commita29aab82be167ff2cc01d0a0090ee5d599faa000 (patch)
treeaf0956f3b10683fd0eb279ba30b35eb28b5954e9 /soxdial
parente6ce9c659342891fd377e88d53faaa1f1154f33b (diff)
downloadmisc-scripts-a29aab82be167ff2cc01d0a0090ee5d599faa000.tar.gz
soxdial: fix timing for bluebox kp and kp2.
Diffstat (limited to 'soxdial')
-rwxr-xr-xsoxdial7
1 files changed, 5 insertions, 2 deletions
diff --git a/soxdial b/soxdial
index f622a84..f86bd72 100755
--- a/soxdial
+++ b/soxdial
@@ -407,8 +407,9 @@ sub add_bluebox_digit {
# --norm is needed because otherwise, the volume decreases as the number of
# digits (tones for "synth") goes up. --norm=-3 helps avoid clipping.
sub make_sox_subcmd {
+ my $length = shift || $digittime;
my $cmd = "sox -n -b$bits $encoding -r$rate -c1 -traw - --norm=-3 ";
- my $synth = " synth $digittime ";
+ my $synth = " synth $length ";
my $delay = "delay ";
for(0..$#freqs1) {
@@ -654,8 +655,10 @@ for ($argc = 0; $argc < @ARGV; $argc++) {
}
warn "$SELF: start dial string '$_'\n" if $verbose;
+ my $time_override;
if($bluebox) {
if(/^(?:st[23]?|kp2?)/) {
+ $time_override = 0.1 if $_ eq 'kp' || $_ eq 'kp2';
add_bluebox_digit($_);
} else {
add_bluebox_digit($_) for split "", $_;
@@ -672,7 +675,7 @@ for ($argc = 0; $argc < @ARGV; $argc++) {
add_digit($digit);
}
}
- push @sox_subcmds, make_sox_subcmd();
+ push @sox_subcmds, make_sox_subcmd($time_override);
push @sox_subcmds, silence_subcmd(randomize($intertime));
warn "$SELF: end dial string '$_'\n" if $verbose;