Previous Topic Index Next Topic
[API function]

FSOUND_SetPan

Sets a channels pan position linearly

signed char F_API FSOUND_SetPan(
int channel,
int pan
);

Parameters

channel The channel number/handle to change the pan for. FSOUND_ALL can also be used (see remarks)
pan The panning position for this channel to set.
parameters are:
- from 0 (full left) to 255 (full right)
- FSOUND_STEREOPAN. This is meant for stereo samples, but will work on mono
samples as well. It makes both left and right FULL volume instead of 50/50
as middle panning does. See remarks section for more information on this.

Return Value

On success, TRUE is returned.
On failure, FALSE is returned.

Remarks

FSOUND_ALL is supported. Passing this will set the pan of ALL channels available.
If FSOUND_ALL is used the last channel success flag will be returned. It is not very useful.
----------
Important : If you are playing a STEREO sample, and using normal middle panning, it will
only come out at half the volume they are supposed to (yes you can pan - or more accurately
'fade' stereo samples using the FSOUND_SetPan command).
The way panning works normally is like this:
full left : 100to left, 0to right
full right : 0to left, 100to right
middle : 50to left, 50to right
To get a stereo sample to play at full volume, there is a special pan command
FSOUND_STEREOPAN which you pass to FSOUND_SetPan. This gives 100to left AND 100to right.
This also works for mono samples, they just come out twice as loud as normal middle as well.
If you are wondering about the logic of 50/50 for middle panning, it can be explained simply
by saying that 100/100 panning just does not sound good. The way it is now each channel
ramps linearly as it moves from left to right or right to left. If it was 100 in each
channel at the middle point, you would not hear one of the channels start to fade until you
passed to the other side of the middle point, which is very harsh.

See Also

FSOUND_DSP_MixBuffers , FSOUND_GetPan , FSOUND_Sample_SetDefaults , FSOUND_SetPan , FSOUND_Stream_Play , FSOUND_Stream_PlayEx

This document copyright ©Firelight Multimedia, 1999-2001. All rights reserved.
Generated Thu Sep 13 00:18:09 2001 by SourceDoc v0.10, the automated source code documenter.