BASS.NET API for the Un4seen BASS Audio Library

BassBASS_SetVolume Method

BASS.NET API for the Un4seen BASS Audio Library
Sets the output master volume.

Namespace:  Un4seen.Bass
Assembly:  Bass.Net (in Bass.Net.dll) Version:

public static bool BASS_SetVolume(
	float volume


Type: SystemSingle
The volume level... 0 (silent) to 1 (max).

Return Value

Type: Boolean
If succesful, then is returned, else is returned. Use BASS_ErrorGetCode to get the error code.

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 app's sounds, BASS_ChannelSetAttribute(Int32, BASSAttribute, Single) 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(Int32)) determines which device this function call applies to.

ERROR CODEDescription
BASS_ERROR_INITBASS_Init(Int32, Int32, BASSInit, IntPtr, IntPtr) 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!

See Also