Firelight Technologies FMOD Studio API
Studio::System::setListenerWeight
Sets the listener weighting, allowing listeners to fade in and out.
C++ Syntax
FMOD_RESULT Studio::System::setListenerWeight(
int listener,
float weight
);
C Syntax
FMOD_RESULT FMOD_Studio_System_SetListenerWeight(
FMOD_STUDIO_SYSTEM *system,
int listener,
float weight
);
C# Syntax
RESULT Studio.System.setListenerWeight(
int listener,
float weight
);
JavaScript Syntax
System.setListenerWeight(
listener,
weight
);
Parameters
- listener
- Listener index.
- weight
- The weighting value from 0 to 1.
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
Listener weighting is a factor that determines how much the listener contributes to the mix. It is taken into account for 3D panning, doppler, and the automatic distance event parameter. A listener with a weight of 0 has no effect on the mix.
Listener weighting can be used to fade in and out multiple listeners. For example to do a crossfade, an additional listener can be created with a weighting of 0 that ramps up to 1 while the old listener weight is ramped down to 0. After the crossfade is finished the number of listeners can be reduced to 1 again.
The sum of all the listener weights should add up to at least 1. It is a user error to set all listener weights to 0.
See Also
- Studio::System::getListenerWeight
- Studio::EventInstance::set3DAttributes
- Studio::System::setNumListeners
- Studio::System::getListenerAttributes
Version 1.10.03 Built on Feb 1, 2018