Sets the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.

BOOL BASS_ChannelSet3DAttributes(
    DWORD handle,
    int mode,
    float min,
    float max,
    int iangle,
    int oangle,
    float outvol


handleThe channel handle... a HCHANNEL, HMUSIC, HSTREAM.
modeThe 3D processing mode... one of these flags, -1 = leave current.
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, 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.
minThe minimum distance. The channel's volume is at maximum when the listener is within this distance... 0 or less = leave current.
maxThe maximum distance. The channel's volume stops decreasing when the listener is beyond this distance... 0 or less = leave current.
iangleThe angle of the inside projection cone in degrees... 0 (no cone) to 360 (sphere), -1 = leave current.
oangleThe angle of the outside projection cone in degrees... 0 (no cone) to 360 (sphere), -1 = leave current.
outvolThe delta-volume outside the outer projection cone... 0 (silent) to 1 (same as inside the cone), less than 0 = leave current.

Return value

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

Error codes

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.


The iangle and oangle parameters must both be set in a single call of this function; one cannot be set 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 (BASS_ATTRIB_VOL attribute). 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.

See also

BASS_ChannelGet3DAttributes, BASS_ChannelSet3DPosition, BASS_ChannelSetAttribute