BASS_SetA3DResManager
Sets the A3D resource management mode.
BOOL WINAPI BASS_SetA3DResManager(
DWORD mode
); |
Parameters
mode | One of these modes.
A3D_RESMODE_OFF | Disables resource management... the standard DirectSound method, and the default mode.
| A3D_RESMODE_DYNAMIC | Non-looping sound playback is optimized via the resource manager. If a channel is played and there are no available resources, another channel will be stopped and replaced with the new one. Looping channels will not be stopped and are never automatically switched out.
| A3D_RESMODE_DYNAMIC_LOOPERS requires A3D 1.2 | Identical to the previous mode, except looping channels are also managed. Management is handled by limiting the number of looping channels to half the hardware's capacity. The loudest channels are always given priority... as sounds move around in the 3D world, the most prevalent sounds are always playing.
| A3D_RESMODE_NOTIFY | If there aren't any hardware resources left, trying to play a channel will fail and return an error to indicate this. Stopping one or more playing channels (channels of different formats can take up more or less hardware resources) will then allow the target channel to play. This mode is helpful for applications that do their own resource management. | |
Return value
If succesful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_NOA3D | The current device does not support A3D, or BASS_DEVICE_A3D was not specified with BASS_Init. |
BASS_ERROR_ILLPARAM | The mode is invalid. |
Remarks
For best performance, always use 22kHz, 16-bit mono samples. Using the same format samples optimizes resource management, and 22kHz, 16-bit is the optimal format for most A3D sound cards. Other formats and sample rates could reduce the number of available A3D channels, or otherwise degrade the sound quality. When the resource manager is enabled, many A3D sound cards will down-sample 44kHz samples to 22kHz. This assures the number of concurrent A3D sources are maximized.
See also
BASS_GetA3DResManager, BASS_GetInfo