diff options
author | B. Watson <urchlay@slackware.uk> | 2024-04-12 13:05:19 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-04-12 13:05:38 -0400 |
commit | c2a1796507e20b6bcdb5f5a86d5bfd9bf0757303 (patch) | |
tree | b13d566842c06a7e1ebcb8d66cc066d8d4633ad3 | |
parent | 6b114986cad96a2d8f04619207376c5720e76991 (diff) | |
download | soxdial-c2a1796507e20b6bcdb5f5a86d5bfd9bf0757303.tar.gz |
soxdial: fix derpage that broke playing, don't play anything for dial strings with no valid digits.
-rwxr-xr-x | soxdial | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -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; } |