ELSE BEGIN
IF sample_size < 65536 THEN
BEGIN
samp_char_1 := CHR(sample_size div 256);
samp_char_2 := CHR((sample_size div 256) + 1);
samp_char_3 := CHR(0);
END
ELSE
BEGIN
samp_char_1 := CHR(sample_size div 65536);
samp_char_2 := CHR(sample_size div 65536);
samp_char_3 := chr((sample_size div 65536) + 1);
END;
END;WRITE(header_part, samp_char_1, samp_char_2, samp_char_3);
In other words, a file less than 256 bytes is encoded by just using
the corresponding ASCII code. A file from 257 bytes to 65535 bytes
uses TWO bytes to signify file size. A file from 65536 onward and
upward uses THREE bytes to signify file size!
I’m not an engineer, and this whole idea is just a little beyond me,
but the power of HACK helped me immensely here!
1.37: first working copy.
Also, there is a “click” at the beginning of the sound file. This
is merely the header of the ORIGINAL file, which can easily be
edited out.
January 14 – 24, 1993
1.00 to 1.36: struggled to get a working copy of this program going!
January 14, 1993 – start of the programming for CONV2SND!
atari, amiga, tandy, soundblaster, sun, all create the same basic
digitized sound files.
the difference lies in the ‘header’.
the header of a file is a small series of bytes, 44 in the case of
DeskMate .SND files. The purpose of a header?
a header tells the program how big the file is, as most programs
that read digitized sound files need to be specially told how many
bits of sound it needs to load up. it also might tell you the ‘name’
or description of the sound file. the sampling rate (how fast the
sound was recorded and should be played back) is also usually
included.
“