aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-10 15:03:26 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-11 16:52:48 -0400
commitb4d72e7e89744cc8d2c65cd866d20d9aa39d3b5d (patch)
treefca7f873fcd1d4464a573974508671b6371052df
parentc43684f6bb431074049ac1931b9600c8ec3198a7 (diff)
downloadsoxdial-b4d72e7e89744cc8d2c65cd866d20d9aa39d3b5d.tar.gz
soxdial: fix timing for bluebox kp and kp2.
-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;