diff options
author | B. Watson <urchlay@slackware.uk> | 2024-04-08 19:59:19 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-04-11 16:52:47 -0400 |
commit | 519efa932da5688f3603628d7136a46421d95681 (patch) | |
tree | 3b7dd51f53ede694699ecaf8adcb52f4388e7029 | |
parent | 4367691d8d69319a44c538fff976cb7c4e10079d (diff) | |
download | soxdial-519efa932da5688f3603628d7136a46421d95681.tar.gz |
soxdial: don't allow stereo/left/right after a dial string.
-rwxr-xr-x | soxdial | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -430,6 +430,10 @@ sub parse_rate { return $_; } +sub check_stereo { + die "$SELF: can't enable stereo after a dial string.\n" if @sox_subcmds; +} + # main() if(system("sox --version > /dev/null 2>&1") != 0) { die "$SELF: can't execute sox, is it installed?\n"; @@ -508,11 +512,14 @@ for ($argc = 0; $argc < @ARGV; $argc++) { } elsif(/^--?s(?:ilence)?$/) { push @sox_subcmds, silence_subcmd(parse_sec($ARGV[++$argc])); } elsif(/^--?(?:S|stereo)$/) { + check_stereo(); $stereo = 1; } elsif(/^--?(?:L|left)$/) { + check_stereo(); $right = 0; $stereo = $left = 1; } elsif(/^--?(?:R|right)$/) { + check_stereo(); $left = 0; $stereo = $right = 1; } elsif(/^--?(?:X|random)$/) { |