BASS_ChannelSet3DAttributes

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

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

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

Return value
If succesful, 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... it wasn't created or loaded with the BASS_xxx_3D flag.

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_ChannelSetAttributes. 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_ChannelSetAttributes