Tao.Sdl SDK Documentation

SdlMixer.Mix_SetPosition Method 

Panning(angular) and distance

[Visual Basic]
Public Shared Function Mix_SetPosition( _
   ByVal channel As Integer, _
   ByVal angle As Short, _
   ByVal distance As Byte _
) As Integer
[C#]
public static int Mix_SetPosition(
   int channel,
   short angle,
   byte distance
);

Parameters

channel
Channel number to register this effect on. Use MIX_CHANNEL_POST to process the postmix stream.
angle
Direction in relation to forward from 0 to 360 degrees. Larger angles will be reduced to this range using angles % 360. 0 = directly in front. 90 = directly to the right. 180 = directly behind. 270 = directly to the left. So you can see it goes clockwise starting at directly in front. This ends up being similar in effect to Mix_SetPanning.
distance
The distance from the listener, from 0(near/loud) to 255(far/quiet). This is the same as the Mix_SetDistance effect.

Return Value

Zero on errors, such as an invalid channel, or if Mix_RegisterEffect failed.

Remarks

Binds to C-function in SDL_mixer.h

int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance)
            

Example

            // set channel 2 to be behind and right, and 100 units away
                    if(!Mix_SetPosition(2, 135, 100))
                {
                    printf("Mix_SetPosition: %s\n", Mix_GetError());
                    // no position effect, is it ok?
                }
            

See Also

SdlMixer Class | Tao.Sdl Namespace | Mix_SetPanning | Mix_SetDistance | Mix_UnregisterAllEffects