BASS.NET API for the Un4seen BASS Audio LibraryBassWasapiBASS_WASAPI_SetVolume Method BASS.NET API for the Un4seen BASS Audio Library
Sets the volume of the current Wasapi device/driver (endpoint).

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

public static bool BASS_WASAPI_SetVolume(
	BASSWASAPIVolume curve,
	float volume


Type: Un4seen.BassWasapiBASSWASAPIVolume
Volume curve to use, one of the following:
BASS_WASAPI_CURVE_DBLogarithmic curve.
BASS_WASAPI_CURVE_WINDOWSWindows' hybrid curve.
BASS_WASAPI_VOL_SESSIONSet the session volume, else the device volume.
Type: SystemSingle
The new volume to set between 0.0 (silent) and 1.0 (maximum) if linear, or else a dB level.

Return Value

Type: Boolean
Returns on success, else is returned. Use BASS_ErrorGetCode to get the error code.

Session volume only affects the current process, so other users of the device are unaffected. It has no effect on exclusive mode output, and maps to the device volume with input devices (so does affect other users). Session volume always uses the BASS_WASAPI_CURVE_WINDOWS curve. If you need to control the volume of the stream only, you need to apply that directly within the WASAPIPROC yourself.

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

ERROR CODEDescription
BASS_ERROR_INITBASS_WASAPI_Init(Int32, Int32, Int32, BASSWASAPIInit, Single, Single, WASAPIPROC, IntPtr) has not been successfully called.
BASS_ERROR_NOTAVAILThere is no volume control available.
BASS_ERROR_ILLPARAMvolume is invalid.
BASS_ERROR_UNKNOWNSome other mystery problem!

See Also