From c2a1796507e20b6bcdb5f5a86d5bfd9bf0757303 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 12 Apr 2024 13:05:19 -0400 Subject: soxdial: fix derpage that broke playing, don't play anything for dial strings with no valid digits. --- soxdial | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/soxdial b/soxdial index 39fbb53..a836fb8 100755 --- a/soxdial +++ b/soxdial @@ -495,13 +495,15 @@ sub set_dialtone_type { # final sox command, to which we pipe all the others. sub make_sox_cmd { - # support quotes, spaces, etc in filenames. - # this can probably be fooled by a determined luser. - $output =~ s,",\\",g; - $output = "\"$output\""; - - if($output !~ /\./) { - $output = "-t raw $output"; + if($output ne '-d') { + # support quotes, spaces, etc in filenames. + # this can probably be fooled by a determined luser. + $output =~ s,",\\",g; + $output = "\"$output\""; + + if($output !~ /\./) { + $output = "-t raw $output"; + } } my $ch = $stereo ? "channels 2" : ""; @@ -706,8 +708,12 @@ for ($argc = 0; $argc < @ARGV; $argc++) { add_digit($digit); } } - push @sox_subcmds, make_sox_subcmd($time_override); - push @sox_subcmds, silence_subcmd(randomize($intertime)); + if(@freqs1) { + push @sox_subcmds, make_sox_subcmd($time_override); + push @sox_subcmds, silence_subcmd(randomize($intertime)); + } else { + warn "$SELF: no valid digits in dial string.\n" if $verbose; + } warn "$SELF: end dial string '$_'\n" if $verbose; } -- cgit v1.2.3