From 20e5469d6ff26335652751bbd241aa6c1742d163 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 11 Apr 2024 15:05:05 -0400 Subject: soxdial: support spaces in extensionless output filenames, too. --- soxdial | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'soxdial') diff --git a/soxdial b/soxdial index 519e4dd..4127951 100755 --- a/soxdial +++ b/soxdial @@ -494,21 +494,24 @@ 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"; - } else { - # support quotes, spaces, etc in filenames. - # this can probably be fooled by a determined luser. - $output =~ s,",\\",g; - $output = "\"$output\""; } + my $ch = $stereo ? "channels 2" : ""; + my $remix = ""; if($left) { $remix = "remix 1 1v0"; } elsif($right) { $remix = "remix 1v0 1"; } + my $cmd = "sox -traw -b$bits $encoding -r$rate -c1 - $output $ch $remix"; my $subcmds = join(" ; ", @sox_subcmds); return "( " . $subcmds . " ) | " . $cmd; -- cgit v1.2.3