home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio Version 4.94
/
audioversion4.94knowledgemediaresourcelibraryoctober1994.iso
/
msdos
/
players
/
blast13
/
blaster.doc
< prev
next >
Wrap
Text File
|
1991-07-11
|
5KB
|
158 lines
/*
Turbo C Blaster Interface
by Shawn Leaf & Joel Lucsy
Vroom-Diggy-Diggy Software, (c) 1991
Defined Macros:
SBOK Return value indicating success for some functions.
SBON For speaker switch: sets speaker on.
SBOFF For speaker switch: sets speaker off.
Types Defined:
sbvoc_type Voice file type. This is a pointer--load voice file
will do the memory allocation.
status_type Variable used to keep track of record & playback
status.
Functions Defined For Driver:
int load_drv(void)
-Loads CT-VOICE.DRV.
-Uses the SOUND environment variable if found.
-Returns SBOK on success.
int load_snd(char *filename;sbvoc_type *sound_file)
-Loads voc file named filename and points sound_block to it.
-Takes care of memory allocation.
-Returns SBOK on success.
int save_snd(char *filename;sbvoc_type sound_file)
-Saves to a voc file named filename. Automagically creates a header.
-Returns SBOK on success.
int alloc_snd(sbvoc_type *sound_file;unsigned long size)
-Allocates enough memory for sound and extra for a header.
-Sound_file will contain the new address for the sound if successful.
-Returns SBOK on success.
void get_vers(void)
-Returns version number: high byte=major number, low byte=minor.
void set_base_io(int base_adr)
-Sets base I/O address used by driver.
-Legal addresses are 0x210, 0x220, 0x230, 0x240, 0x260, and 0x260.
-Use before init_driver()
void set_interrupt_num(int number)
-Sets the interrupt number used by the driver during DMA.
-Interrupts available: 2, 3, 5, and 7.
-Use before init_driver()
int init_drv(void)
-Initializes Sound Blaster card.
-Returns SBOK on success.
-Error conditions: 1 - Voice Card Fails
2 - I/O Read/Write Fails
3 - Interrupt or DMA Fails
void set_speaker(void)
-Sets speaker's connection to the DAC on (SBON) or off (SBOFF).
-Init_driver turns speaker on.
-Turn speaker off on exit of application.
-Turn speaker off to record or recording will output while being
digitized.
void set_status(status_type *mem_loc)
-Causes the driver to store the status of the card in variable
passed.
-Note, the variable should be passed with the & operator.
-Must be set before output_snd is called.
void play_snd(sbvoc_type sound_file)
-Outputs the sound file to the speaker using DMA.
-The status variable contains 0 when output is complete.
-Status is also updated to value of any markers in the file.
-Output_snd and Record_snd should not be called until current sound
has stopped or has been stopped.
void record_snd(sbvoc_type sound_file;int sampling_rate,length)
-Begins sampling & storing in sound_file.
-Does not allocate memory for sound.
-Status word will become a 0 when sound_file is full or sampling is
stopped with stop_snd
void stop_snd(void)
-Terminates any voice I/O process.
void uninstall(void)
-Sets Sound Blaster to its normal condition and disconnects DAC from
speaker.
-Deallocates the driver's memory.
int pause_snd(void)
-Pauses sound output.
-Returns SBOK if successful, otherwise a sound wasn't playing.
-Status variable will remain non-zero in paused state.
int cont_snd(void)
-Continues paused output.
-Returns SBOK on success.
int brk_repeat(int mode)
-Breaks out of repeating voice blocks.
-Mode=1: current round is stopped immediately and voice continues
with next block.
-Mode=0: current round is not stopped, but when it completes, voice
continues with next block.
void unload_snd(sbvoc_type sound_file)
-Deallocates memory for sound_file
Environment Variable:
The newer release of the Sound Blaster (v1.5) has included an
option to set up an environment variable to locate the CT-VOICE.DRV
file so that it would not be needed all over one's hard drive in
whatever directory you needed it in. This environment variable would
look something like this:
SOUND=C:\SB
The actual driver would then be in a DRV directory underneath the SB
directory. The directory structure would look something like:
\
└─SB
└──DRV
Current releases of their software take advantage of this feature,
as do we! All one needs is to include a line in your autoexec to
set up the environment variable. Older software that has no idea
there is an environment variable still needs the extra copies of
the driver in their directory, but with the variable the need for
extra copies is greatly reduced.
** Sound Blaster is a copyright of Creative Labs, Inc. **
*/