CRI ADX  Last Updated: 2024-07-17 10:47 p
Multichannel Playback

Samples Directory

/CRIWARE/SDK/pc/samples/criatomex/playback_multi_ch


Sample Description

The number of channels to which Voice can be sent is specified when you create a Voice Pool.

By default, Voice Pool creation parameter ( CriAtomExHcaVoicePoolConfig ) is set so that Voices which support 2-channel (stereo) playback.
For example, in order to play back 5.1ch (6ch) Cue, you must modify it.

Following is a code to set number of channels a Voice can play.

CriAtomExVoicePoolHn hcavoice_pool;
/* Initialize parameters for creating Voice Pool with default value */
/* Modify the number of channels that can be played back */
vp_config.player_config.max_channels = 6;
/* Create a Voice Pool by passing the modified handle creation parameter */
hcavoice_pool = criAtomExVoicePool_AllocateHcaVoicePool(&vp_config, NULL, 0);
/* Create a player */
player = criAtomExPlayer_Create(NULL, NULL, 0);
/* Set Cue ID */
criAtomExPlayer_SetCueId(player, acb_hn, CRI_ATOMCUESHEET__6CH);
/* Start playback */
CriAtomExAcbObj * CriAtomExAcbHn
ACB handle.
Definition: cri_le_atom_ex.h:3033
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
Start the playback.
CriAtomExPlayerObj * CriAtomExPlayerHn
Player handle.
Definition: cri_le_atom_ex.h:3622
CriAtomExPlayerHn criAtomExPlayer_Create(const CriAtomExPlayerConfig *config, void *work, CriSint32 work_size)
Create an AtomEx player.
void criAtomExPlayer_SetCueId(CriAtomExPlayerHn player, CriAtomExAcbHn acb_hn, CriAtomExCueId id)
Set the sound data to play (specifying a Cue ID)
#define criAtomExVoicePool_SetDefaultConfigForHcaVoicePool(p_config)
Assign the default values to the configuration structure used to create an HCA Voice Pool.
Definition: cri_le_atom_ex.h:600
struct CriAtomExVoicePoolTag * CriAtomExVoicePoolHn
Voice Pool handle.
Definition: cri_le_atom_ex.h:3220
CriAtomExVoicePoolHn criAtomExVoicePool_AllocateHcaVoicePool(const CriAtomExHcaVoicePoolConfig *config, void *work, CriSint32 work_size)
Create an HCA Voice Pool.
Configuration structure used when creating a HCA Voice Pool.
Definition: cri_le_atom_ex.h:3299
CriAtomHcaPlayerConfig player_config
Definition: cri_le_atom_ex.h:3302
CriSint32 max_channels
Maximum number of output channels.
Definition: cri_le_atom.h:1728


As the number of channels increases, work size used by a Voice Pool also increases.
By creating separate Voice Pools for multichannel and up to stereo Cue playback, adjust the consumed work size so that it does not increase so much.

Above code is for HCA Voice Pool. If the user wants to use it in ADX, simply change "HCA" to "ADX."