Firelight Technologies FMOD Studio API
Channel::setPan
Sets the pan level, this is a helper to avoid calling ChannelControl::setMixMatrix.
C++ Syntax
FMOD_RESULT Channel::setPan(
float pan
);
C Syntax
FMOD_RESULT FMOD_Channel_SetPan(
FMOD_CHANNEL *channel,
float pan
);
C# Syntax
RESULT Channel.setPan(
float pan
);
JavaScript Syntax
Channel.setPan(
pan
);
Parameters
- pan
- Pan level, from -1.0 (left) to 1.0 (right), default = 0 (center).
Return Values
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
Remarks
Mono sounds are panned from left to right using constant power panning (non linear fade). This means when pan = 0.0, the balance for the sound in each speaker is 71% left and 71% right, not 50% left and 50% right. This gives (audibly) smoother pans.
Stereo sounds heave each left/right value faded up and down according to the specified pan position. This means when pan = 0.0, the balance for the sound in each speaker is 100% left and 100% right. When pan = -1.0, only the left channel of the stereo sound is audible, when pan = 1.0, only the right channel of the stereo sound is audible.
Panning does not work if the speaker mode is FMOD_SPEAKERMODE_RAW.
See Also
Version 1.10.03 Built on Feb 1, 2018