DQBinstallSB
FUNCTION

Prototype

DECLARE FUNCTION DQBinstallSB (BYVAL VolActive, BYVAL Voices, BYVAL Freq,
                               BYVAL BaseAddr, BYVAL IRQ, BYVAL DMA)

Parameters

VolActive - True to preserve base memory for the voices volume table

Voices - Number of voices to mix at real-time

Freq - Sampling rate

BaseAddr - Base address of your soundcard

IRQ - IRQ number setting

DMA - Low DMA channel to be used

Returns

An INTEGER value holding the initialization result. It can be: > 0 Initialization successful > 1 No sounds were allocated by DQBinit > 2 Soundcard not found or DSP failed to reset > 3 Old soundcard not supported > 4 Specified DMA channel is not supported > 5 Autodetection failed as the BLASTER variable is not set > 6 High mixing speed not supported > 7 Not enough memory to create the volume table

Description

DQBinstallSB installs a custom IRQ routine and starts the sound engine if all goes ok. If you don't know your sound settings (base address, IRQ or DMA), you can pass the AUTO constant as the missing parameter(s); this will force the function to search the BLASTER environmental variable (if available) for the right setting. The number of voices can range from 1 up to 32, and tells the sound engine how many digital sound channels to mix at real-time; needless to say, on older computers, too many voices will slow down your programs... The sampling rate may range from 4000 Hz up to 23000 Hz. If you specify true as the VolActive parameter, you'll need 16K of base memory, as the function will build an internal volume table, that will allow you to set custom volume settings to each of the initialized voices; if you don't need to play sounds with different volumes at the same time, you don't need this table, so just pass false to this function.

Notes:

As always, the SETMEM function should be used to free memory from QB, if you need base memory for the volume table. To turn the sound engine off, call DQBremoveSB; this is anyway automatically called for you by DQBclose. See also DQBloadSound, DQBplaySound, DQBstopVoice

Example

See DQBplaySound example