BASS.NET API for the Un4seen BASS Audio Library

BassBASS_Set3DFactors Method

BASS.NET API for the Un4seen BASS Audio Library
Sets the factors that affect the calculations of 3D sound.

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

[DllImportAttribute("bass")]
public static bool BASS_Set3DFactors(
	float distf,
	float rollf,
	float doppf
)

Parameters

distf
Type: SystemSingle
The distance factor... less than 0.0 = leave current... examples: 1.0 = use meters, 0.9144 = use yards, 0.3048 = use feet. By default BASS measures distances in meters, you can change this setting if you are using a different unit of measurement.
rollf
Type: SystemSingle
The rolloff factor, how fast the sound quietens with distance... 0.0 (min) - 10.0 (max), less than 0.0 = leave current... examples: 0.0 = no rolloff, 1.0 = real world, 2.0 = 2x real.
doppf
Type: SystemSingle
The doppler factor... 0.0 (min) - 10.0 (max), less than 0.0 = leave current... examples: 0.0 = no doppler, 1.0 = real world, 2.0 = 2x real. The doppler effect is the way a sound appears to change pitch when it is moving towards or away from you (say hello to Einstein!). The listener and sound velocity settings are used to calculate this effect, this doppf value can be used to lessen or exaggerate the effect.

Return Value

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

As with all 3D functions, use BASS_Apply3D to apply the changes.

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_NO3DThe device was not initialized with 3D support.

Examples

To use yards as the distance measurement unit, while leaving the current rolloff and doppler factors untouched:
Bass.BASS_Set3DFactors(0.9144f, -1f, -1f);
Bass.BASS_Apply3D(); // apply the change
See Also

Reference