BASS.NET API for the Un4seen BASS Audio Library

BassBASS_ChannelSet3DAttributes Method

BASS.NET API for the Un4seen BASS Audio Library
Sets the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.

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

[DllImportAttribute("bass")]
public static bool BASS_ChannelSet3DAttributes(
	int handle,
	BASS3DMode mode,
	float min,
	float max,
	int iangle,
	int oangle,
	int outvol
)

Parameters

handle
Type: SystemInt32
The channel handle... a HCHANNEL, HMUSIC, HSTREAM.
mode
Type: Un4seen.BassBASS3DMode
The 3D processing mode... one of these flags, -1 = leave current (see BASS3DMode):
BASS_3DMODE_NORMALNormal 3D processing.
BASS_3DMODE_RELATIVEThe channel's 3D position (position/velocity/orientation) is relative to the listener. When the listener's position/velocity/orientation is changed with BASS_Set3DPosition(BASS_3DVECTOR, BASS_3DVECTOR, BASS_3DVECTOR, BASS_3DVECTOR), the channel's position relative to the listener does not change.
BASS_3DMODE_OFFTurn off 3D processing on the channel, the sound will be played in the centre.
min
Type: SystemSingle
The minimum distance. The channel's volume is at maximum when the listener is within this distance... less than 0.0 = leave current.
max
Type: SystemSingle
The maximum distance. The channel's volume stops decreasing when the listener is beyond this distance... less than 0.0 = leave current.
iangle
Type: SystemInt32
The angle of the inside projection cone in degrees... 0 (no cone) - 360 (sphere), -1 = leave current.
oangle
Type: SystemInt32
The angle of the outside projection cone in degrees... 0 (no cone) - 360 (sphere), -1 = leave current.
outvol
Type: SystemInt32
The delta-volume outside the outer projection cone... 0 (silent) - 100 (same as inside the cone), -1 = leave current.

Return Value

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

The iangle and oangle parameters must both be set in a single call to this function (ie. you can't set one without the other). The iangle and oangle angles decide how wide the sound is projected around the orientation angle. Within the inside angle the volume level is the channel volume, as set with BASS_ChannelSetAttribute(Int32, BASSAttribute, Single). Outside the outer angle, the volume changes according to the outvol value. Between the inner and outer angles, the volume gradually changes between the inner and outer volume levels. If the inner and outer angles are 360 degrees, then the sound is transmitted equally in all directions.

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

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_NO3DThe channel does not have 3D functionality.
BASS_ERROR_ILLPARAMOne or more of the attribute values is invalid.

See Also

Reference