On 2011-11-22, Evangelos R <
ero...@googlemail.com> wrote:
> On Nov 21, 2:09 pm, Andre Majorel <
che...@halliburton.com> wrote:
>
>> So you want to be able to CLOAD into Xeuphoric an audio
>> recording of a regular Oric CSAVE ? And the recording will be in
>> WAV format and probably 16-bit signed 44.1 kHz mono or something
>> like that ?
>
> Yes, something like that.
Then try this. If your WAV isn't already 4.8 kHz, I think you'll
have to use the -s option. E.G.
wav2xht -s 4808 fromoric.wav >toxeuphoric.xht
#!/usr/bin/perl -w
#
# wav2xht - convert WAV to Xeuphoric hardware tape
# AYM 2011-11-21
#
use strict;
use Getopt::Long;
my $mode = 'convert';
my $srate = undef;
Getopt::Long::Configure 'bundling', 'noignorecase';
if (! GetOptions
'help' => sub { $mode = 'help' },
's=s' => \$srate,
)
{
exit 1;
}
if ($mode eq 'help')
{
print <<EOF;
wav2xht - convert WAV to Xeuphoric hardware tape
Usage:
wav2xht --help
wav2xht [-s str] [file ...]
Options:
--help Write usage summary to standard output and exit successfully
-s str Sample rate in any format sox understands
EOF
exit 0;
}
die "wav2xht: standard output is a terminal\n" if -t STDOUT;
binmode STDOUT;
@ARGV = map "\"$_\"", @ARGV ? @ARGV : ('-');
my $opt_srate = defined $srate ? "-r \"$srate\"" : '';
local $/ = undef;
my $data = `sox @ARGV -t raw -u -b 8 -c 1 $opt_srate -`;
die "wav2xht: sox error ($!)\n" if ! defined $data;
die "wav2xht: sox error (killed by signal $?)\n" if ($? & 0x7f) != 0;
my $status = $? >> 8;
die "wav2xht: sox error (exited with status $status)\n" if $status != 0;
print pack 'B*', $data;
> So the recording should be 16-bit signed, 44.1kHz mono to be
> processable by tapetools, isn't it?
Dunno what tapetools requires. I asked because I wanted to know
what I was up against.