Dec 192017
 
TP5.0 unit for playing VOC files in background.
File SBVOICE.ZIP from The Programmer’s Corner in
Category Pascal Source Code
TP5.0 unit for playing VOC files in background.
File Name File Size Zip Size Zip Type
CHESTPAI.VOC 22295 13621 deflated
CT-VOICE.DRV 3910 2647 deflated
PLAYSB.PAS 377 259 deflated
SBVOICE.DOC 4044 1697 deflated
SBVOICE.TPU 4080 1760 deflated

Download File SBVOICE.ZIP Here

Contents of the SBVOICE.DOC file


SBVoice is a TP 5.0 unit for playing soudnblaster .VOC files in the
background or soundblaster compatible cards. Newer versions will support
LPT1 DAC devices.

In order for this unit to work, the CT-VOICE.DRV file(included) must be
present in the current directory when the program runs. If not, it will
screw up and likely crash. Newer versions of this file should be included
with newer cards, but for backward compatability, the one included should be
used unless there is a problem.

PROCEDURES:
Procedure LoadSB(name:String;n:Byte);
Loads the specified VOC file into sound slot n. There are 40 sound slots
allocated by the program allowing 40 sounds to be loaded at once. The file
is expected to be in the VOCPath directory. The .VOC extension should not
be included in the name. Be sure that enough unallocated heap memory
is available for loading the sound. Sounds >64k are not supported.

Procedure LoadSBLib(var Data:File;n:Byte);
Loads a VOC file from the file DATA. DATA is expected to be an untyped
file with a record size of 1 byte. SBLib files are a format I designed
to allow multiple VOC files in one. The format is simply a single WORD
specifying the size, followed by the VOC file. There can be any number
of VOCs located in the file, and some data need not even be sounds.
As long as the file pointer points to a valid size+sound record, the
procedure will return successful. This is useful for storing all
program data in a single file. The file is loaded into sound slot n.
There are 40 sound slots. Be sure that enough unallocated heap memory
is available for loading the sound. Sounds >64k are not supported.

Procedure ClearSB(n:Byte);
This procedure clears the specified sound slot. This must be done
before reading another sound into a sound slot.

Procedure PlaySB(n:Byte);
Plays the spcified sound.

Procedure SetSB(S:Word);
Turns on or off the SB card. The SB is automatically turned on if
it is installed. 1=on, 0=off.

Procedure SetPlayRate(n:Byte;spd:Word);
Sets the sampling rate to play a sample back at. This does not need to
to be called, since the VOC format contains the sampling rate.
Valid rates are 4000 to 44100. Anything below 4000 plays at 4000, anything above 44100 will...
will... do... something. The sampling rate is used for any subsequent
playbacks.

Procedure RemoveSB;
Removes the sound driver, and clears the card. This should be done
before termination of the program.

VOCPath : String;
Contains the default directory for loading .VOC files. By default, this
is the current directory. If you change this variable, be sure to include
the trailing slash. Ex:
VOCPath:='\SB\VOCS\'; Correct;
VOCPath:='\SB\VOCS'; Incorrect;

VOCStatus : Word;
Non-zero when a sound is playing. If any mark or repeat commands are
reached during playback of the file, they will be indicated by the
value in the VOCStatus variable.

SBInstalled: Boolean;
SBVoice auto-detects whether an SB card is installed, and determines
which interrupt. This variable indicates whether a soundblaster or
compatible card with DAC is installed. If this is false, all sound commands
are ignored.

Sounds : Array[1..40] of pointer;
Pointers to the VOC files.

SoundSize : Array[1..40] of Word;
Storage for the sizes of the VOC files loaded. SBVoice cannot play
sound samples >64k.

If you need to contact me, or have some overwhelming urge to send me a large
sum of money,(or even a small one,) I may have an similar overwhelming urge
to send you the source code. I can be reached at:

William Garrison BTW- No, I am not on the Internet, so TUFF COOKIES!
3625 Double Rock Lane
Baltimore, MD 21234

Party On Dudes.
END OF LINE


 December 19, 2017  Add comments

Leave a Reply