CRI ADX  Last Updated: 2024-07-17 10:47 p
Number of Output Channels and Downmixing
The CRI Atom library supports multiple audio output channels such as stereo audio output for handheld gaming devices, 5.1-channel and 7.1-channel surround audio output for game consoles or monaural audio output for devices like gamepads.
The CRI Atom library outputs 5.1-channel audio by default.
This section explains the settings required to output monaural, stereo, and 7.1-channel audio as well as how downmixing works.
Runtime Settings Required for 7.1-channel Audio Output
To output 7.1-channel audio, the following settings are required when the application is run.
(1) Configure the number of output channels for the Atom Sound Renderer (ASR) for 7.1-channel audio output.
When using the ASR, you must set the number of ASR output channels (CriAtomAsrConfig::output_channels) to 8 when initializing the library.
(2) Configure the pan speaker type for 7.1-channel audio output.
Once the library is initialized, use the criAtomExPlayer_ChangeDefaultPanSpeakerType function to set one of the following values.
(3) Configure the maximum number of channels of the voice pool used for 7.1-channel sound materials.
When using 7.1-channel sound materials, set the player_config.max_channels member of the voice pool's configuration structure to 8.
(However, this setting is not required if you will NOT be using 7.1-channel sound materials, like when performing panning on monaural audio for a 7.1-channel audio output.)
Additional Information:
The difference between CRIATOMEX_PAN_SPEAKER_TYPE_6CH and CRIATOMEX_PAN_SPEAKER_TYPE_7CH is whether or not the panning result is also output from the center speaker.
When CRIATOMEX_PAN_SPEAKER_TYPE_7CH is set, the panning result is output from the center speaker.
Stereo Audio Output
No settings are required on the application side.
Stereo downmixing will be performed automatically after calculating the panning internally within the CRI Atom library.
Monaural Audio Output
The CRI Atom library automatically performs monaural downmixing.
Some settings may need to be configured on the application side depending on the platform when outputting audio to peripheral devices such as gamepads.
For details, refer to Other Sound Output Devices in the platform-specific information.
Downmixing
The CRI Atom library performs downmixing when the number of input audio channels is greater than the number of sound renderer output channels.
The number of sound renderer output channels is determined as follows:
  • When Using the Atom Sound Renderer (ASR)
    It is determined by the number of channels set in CriAtomAsrConfig::output_channels.
  • When Not Using the Atom Sound Renderer (ASR) (When Performing Sound Processing by Hardware)
    It is determined by the number of channels of the output destination device. For details, refer to Sound Output in the platform-specific information.
When using the Panning feature, the number of input audio channels will be the number of channels after the panning calculation is performed.
For example, when performing stereo audio output after panning with the default settings, the result of downmixing 5.1-channel audio to 2 channels will be output.
Downmixing Formula
The following table shows the formulas used for downmixing.
Number of input channels Number of output channels Formula (output speaker) = (input speaker)
7.1ch 5.1ch L(mix) = L
R(mix) = R
C(mix) = C
LFE(mix) = LFE
Ls(mix) = Ls + Lb * (-3dB)
Rs(mix) = Rs + Rb * (-3dB)
5.1ch 4ch(L,R,Ls,Rs) L(mix) = L + C * (-3dB)
R(mix) = R + C * (-3dB)
Ls(mix) = Ls
Rs(mix) = Rs
4ch(L,R,Ls,Rs) 2ch L(mix) = L + Ls * (-3dB)
R(mix) = R + Rs * (-3dB)
2ch 1ch MONO(mix) = L * (-3dB) + R * (-3dB)
For any combination not shown in the above table, downmixing is performed in stages.
For example, for downmixing from a 7.1-channel input to a 2-channel output, the downmixing would be performed in the following order: 7.1-channel -> 5.1-channel -> 4-channel -> 2-channel.
As a result, the downmixing formula would be as follows:
L(mix) = L + C * (-3dB) + Ls * (-3dB) + Lb * (-6dB)
R(mix) = R + C * (-3dB) + Rs * (-3dB) + Rb * (-6dB)
Additional Information:
On some platforms the downmixing is not performed internally by the CRI Atom library and is instead performed by the platform's audio system. In this case, the result of the downmixing may differ from what is shown in the table above.
For details, refer to Sound Output in the platform-specific information.