aboutsummaryrefslogtreecommitdiff
path: root/soxdial
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-13 16:28:48 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-13 16:28:48 -0400
commitd1f48f34e8af4842efb6952d72b9a52969e632ea (patch)
treef4e4e36949a8ecf5009ed1b557115ed20ee12938 /soxdial
parent59ea1d3988599b49cff516ae0516fb2c6456ec21 (diff)
downloadsoxdial-d1f48f34e8af4842efb6952d72b9a52969e632ea.tar.gz
soxdial: improve --input/--stdin.
Diffstat (limited to 'soxdial')
-rwxr-xr-xsoxdial12
1 files changed, 9 insertions, 3 deletions
diff --git a/soxdial b/soxdial
index aa5469e..b1c6770 100755
--- a/soxdial
+++ b/soxdial
@@ -590,12 +590,18 @@ sub check_stereo {
sub read_file {
my $file = shift;
my $result = shift;
+ my $filename = ($file eq '-' ? "stdin" : "file '$file'");
+
+ warn "$SELF: reading $filename.\n";
open my $fh, "<$file" or die "$SELF: $file: $!\n";
while(<$fh>) {
chomp;
- push @$result, split "";
+ push @$result, split " ";
}
+
+ warn "$SELF: read " . @$result . " dial strings from $filename.\n" if $verbose;
+
close $fh;
}
@@ -632,6 +638,8 @@ for(@ARGV) {
if($input_seen) {
read_file($_, \@newargv);
$input_seen = 0;
+ } elsif(/^--?v(?:erbose)?$/) {
+ $verbose = 1;
} elsif(/^--?stdin$/) {
read_file("-", \@newargv);
} elsif(/^--?i(?:nput)?=?(.+)?$/) {
@@ -674,8 +682,6 @@ for ($argc = 0; $argc < @ARGV; $argc++) {
$SOX = $ARGV[++$argc];
die "$SELF: missing argument for --sox.\n" unless defined $SOX;
warn "$SELF: sox executable set to '$SOX'\n" if $verbose;
- } elsif(/^--?v(?:erbose)?$/) {
- $verbose = 1;
} elsif(/^--?n(?:oexec)?$/) {
$verbose = 1;
$noexec = 1;