BASS

BASS_SetVolume


Sets the output master volume.

BOOL BASS_SetVolume(
    float volume
);

Parameters

volumeThe volume level... 0 (silent) to 1 (max).

Return value

If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_INIT BASS_Init has not been successfully called.
BASS_ERROR_NOTAVAILThere is no volume control when using the "no sound" device.
BASS_ERROR_ILLPARAMvolume is invalid.
BASS_ERROR_UNKNOWNSome other mystery problem!

Remarks

The actual volume level may not be exactly the same as requested, due to underlying precision differences. BASS_GetVolume can be used to confirm what the volume is.

This function affects the volume level of all applications using the same output device. If you wish to only affect the level of your application's sounds, the BASS_ATTRIB_VOL attribute and/or the BASS_CONFIG_GVOL_MUSIC / BASS_CONFIG_GVOL_SAMPLE / BASS_CONFIG_GVOL_STREAM config options should be used instead.

When using multiple devices, the current thread's device setting (as set with BASS_SetDevice) determines which device this function call applies to.

See also

BASS_GetVolume, BASS_ATTRIB_VOL, BASS_CONFIG_CURVE_VOL, BASS_CONFIG_GVOL_MUSIC, BASS_CONFIG_GVOL_SAMPLE, BASS_CONFIG_GVOL_STREAM