CRI ADX  Last Updated: 2025-05-07 13:34 p
Binaural playback

Sample directory

/cri/pc/samples/criatomex/playback_with_binauralization

Data used in the sample

/cri/common/smpdata/criatomex/
  • Binaural_project.acf
  • Binaural_cue.acb

Sample description

This is a sample that plays multi-channel audio material binaurally.

To use binaural processing, specify CRIATOM_SOUND_RENDERER_SPATIAL as the sound renderer type ( CriAtomExAsrConfig::sound_renderer_type ) in the CriAtomExAsrConfig structure specified when initializing the library.
The code that actually specifies the sound renderer type and initializes the library is shown below.

/* If you want to use binaural processing, set the sound renderer type to special */
asr_config.sound_renderer_type = CRIATOM_SOUND_RENDERER_SPATIAL;
/* Initialize the library */
smputl_initialize_for_spatialaudio(&ex_config, &asr_config, NULL, 0);
@ CRIATOM_SOUND_RENDERER_SPATIAL
Definition: cri_le_atom.h:815

After initializing the library, you can enable or disable binaural processing by executing the criAtomExAsr_EnableBinauralizer function.
You can also check whether binaural processing is enabled or disabled by using the criAtomExAsr_IsEnabledBinauralizer function.
The code to actually enable or disable binaural is shown below.

/* Check whether binaural processing is enabled or disabled and switch it on and off */
CriBool is_binaural = criAtomExAsr_IsEnabledBinauralizer();
if (is_binaural == CRI_FALSE) {
is_binaural = CRI_TRUE;
} else {
is_binaural = CRI_FALSE;
}
CriBool criAtomExAsr_IsEnabledBinauralizer(void)
Get binauralizer enabled state.
void criAtomExAsr_EnableBinauralizer(CriBool enabled)
Enabling the Binauralizer.