[Coco] [Color Computer] Re: Program to convert .cas files to play a a real Coco

gene heskett gheskett at wdtv.com
Sat Dec 25 16:19:13 EST 2010


On Saturday, December 25, 2010 04:13:37 pm Luis Fernández did opine:

> found this
> serves you
> #!/usr/bin/perl -w
> # v0.1: initial version# v0.2: write correct size values into header#
> v0.3: write 9600Hz file# v0.4: simplify writing cycle data use Fcntl
> qw(:seek);
> unless (defined $ARGV[1]) {	print STDERR "usage: $0 INFILE
> OUTFILE\n";	print STDERR "INFILE is Dragon/Tandy CoCo CAS
> file\n";	print STDERR "OUTFILE will be 9600Hz WAV\n";	exit 1;}die
> unless open (my $in, "<", $ARGV[0]);die unless open (my $out, ">",
> $ARGV[1]); my $wav_header =
> "524946460000000057415645666d742010000000010001008025000080250000010008
> 006461746100000000"; print $out pack("H*", $wav_header);my $count = 0;
> my $c;while (sysread($in, $c, 1) > 0) {	$c = ord($c);	for my $i 
(0..7)
> {		if ($c & 0x01) {			print $out pack("H*", 
"80ff8001");			$count +=
> 4;		} else {			print $out pack("H*", 
"80d9ffd980270127");			$count +=
> 8;		}		$c >>= 1;	}} seek($out, 40, 
SEEK_SET);print $out pack("C",
> $count & 0xff);print $out pack("C", ($count >> 8) & 0xff);print $out
> pack("C", ($count >> 16) & 0xff);print $out pack("C", ($count >> 24) &
> 0xff);$count += 36;seek($out, 4, SEEK_SET);print $out pack("C", $count
> & 0xff);print $out pack("C", ($count >> 8) & 0xff);print $out pack("C",
> ($count >> 16) & 0xff);print $out pack("C", ($count >> 24) & 0xff);
> close $out;exit 0;

Luis:  Can you resend this but as an attachment so we can save it in the 
original format?  I get the impression that your email agents line wrapping 
may not have done it any favors.  That is if this server will pass 
attachments, otherwise put it on one of the pastebin sites with about a 
weeks lifetime & post the link, and those of us who could use it can go get 
a good copy.

Thanks & Merry Christmas.

> > To: ColorComputer at yahoogroups.com
> > From: nitrofurano at gmail.com
> > Date: Sun, 19 Dec 2010 14:50:53 +0000
> > Subject: [Coco] [Color Computer] Re: Program to convert .cas files to
> > play a	a real Coco
> > 
> > --- In ColorComputer at yahoogroups.com, "Charles" <cwils96 at ...> wrote:
> > > Is there an easy way to convert .cas files to play a a real Coco ?
> > > i have tried several programs with no luck.
> > > thanks
> > 
> > i'm looking for a .cas to .wav converter for Linux or MacOS-X, but
> > since both .cas and .wav seems to be easy to hardcode, would be great
> > if some useful documentation and some simple script (coded in a
> > language like Python) would be awesome - i want to help on coding it
> > if no one started, and i just need documentation and feedback from
> > people could test it (i don't have a real CoCo now)
> > 
> > cheers,
> > p.
> > 

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Experience is what you get when you were expecting something else.



More information about the Coco mailing list