Sets the volume level of each channel of the final output for the voice. These channels are mapped to the input channels of a specified destination voice.
\\HRESULT SetOutputMatrix( IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, const float *pLevelMatrix, UINT32 OperationSet X2DEFAULT );
Pointer to a destination IXAudio2Voice for which to set volume levels.
Confirms the output channel count of the voice. This is the number of channels that are produced by the last effect in the chain.
Confirms the input channel count of the destination voice.
Array of [SourceChannels × DestinationChannels] volume levels sent to the destination voice. The level sent from source channel S to destination channel D is specified in the form pLevelMatrix[SourceChannels × D + S].
For example, when rendering two-channel stereo input into 5.1 output that is weighted toward the front channels—but is absent from the center and low-frequency channels—the matrix might have the values shown in the following table.
|Output||Left Input [Array Index]||Right Input [Array Index]|
|Left||1.0 ||0.0 |
|Right||0.0 ||1.0 |
|Front Center||0.0 ||0.0 |
|LFE||0.0 ||0.0 |
|Rear Left||0.8 ||0.0 |
|Rear Right||0.0 ||0.8 |
Returns S_OK if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.
This method is valid only for source and submix voices, because mastering voices write directly to the device with no matrix mixing.
Volume levels are expressed as floating-point amplitude multipliers between -XAUDIO2_MAX_VOLUME_LEVEL and XAUDIO2_MAX_VOLUME_LEVEL (-2²⁴ to 2²⁴), with a maximum gain of 144.5 dB. A volume level of 1.0 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.