diff options
author | B. Watson <urchlay@slackware.uk> | 2024-04-08 19:59:19 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-04-08 19:59:19 -0400 |
commit | 041f0a71e0a6d695d498e9afdaf37744dc7e59fb (patch) | |
tree | 62c84d4f4932b06b0b967ac096c1d6b040acf75f | |
parent | 8bd615b9fe567b87472318ec859db0055b4ebd0e (diff) | |
download | misc-scripts-041f0a71e0a6d695d498e9afdaf37744dc7e59fb.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)$/) { |