aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-12 13:05:19 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-12 13:05:38 -0400
commitc2a1796507e20b6bcdb5f5a86d5bfd9bf0757303 (patch)
treeb13d566842c06a7e1ebcb8d66cc066d8d4633ad3
parent6b114986cad96a2d8f04619207376c5720e76991 (diff)
downloadsoxdial-c2a1796507e20b6bcdb5f5a86d5bfd9bf0757303.tar.gz
soxdial: fix derpage that broke playing, don't play anything for dial strings with no valid digits.
-rwxr-xr-xsoxdial24
1 files 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;
}