Firelight Technologies FMOD Studio API
Channel::setMixLevelsInput
Sets the incoming volume level for each channel of a multi-channel sound. This is a helper to avoid calling ChannelControl::setMixMatrix.
A multi-channel sound is a single sound that contains from 1 to 32 channels of sound data, in an interleaved fashion. If in the extreme case, a 32ch wave file was used, an array of 32 floating point numbers denoting their volume levels would be passed in to the levels parameter, and 32 for the numlevels parameter.
C++ Syntax
FMOD_RESULT Channel::setMixLevelsInput(
float *levels,
int numlevels
);
C Syntax
FMOD_RESULT FMOD_Channel_SetMixLevelsInput(
FMOD_CHANNEL *channel,
float *levels,
int numlevels
);
C# Syntax
RESULT Channel.setMixLevelsInput(
float[] levels,
int numlevels
);
JavaScript Syntax
Channel.setMixLevelsInput(
levels,
numlevels
);
Parameters
- levels
- Array of volume levels for each incoming channel.
- numlevels
- Number of levels in the array, from 0 to 32 inclusive.
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
An example use case for this function is if the sound file has multiple channels in it with different musical parts to it, but they are all in sync with each other. This function can be used to fade in and out different tracks of the sound or to solo/mute tracks within it.
NOTE: This function overwrites any pan/output mixlevel by overwriting the ChannelControl's matrix if it exists. It will create an NxN matrix where the output levels are the same as the input levels. If you wish to fold this down to a lower channel count mix rather than staying at the input channel count, either create a custom matrix instead and use ChannelControl::setMixMatrix, or add a new DSP after the fader, that has a different channel format (ie with ChannelControl::getDSP and DSP::setChannelFormat).
NOTE: Levels can be below 0 to invert a signal and above 1 to amplify the signal. Note that increasing the signal level too far may cause audible distortion.
See Also
- ChannelControl::setMixMatrix
- ChannelControl::getMixMatrix
- ChannelControl::getDSP
- DSP::setChannelFormat
- FMOD_CHANNELCONTROL_DSP_INDEX
Version 1.10.03 Built on Feb 1, 2018