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

Samples Directory

/CRIWARE/SDK/pc/samples/criatomex/playback_multi_codec


Sample Description

When there are two or more codecs the Cues included in an ACB file, by creating a Voice Pool for each codec in advance, you can play back sounds without noticing which codec the Cue to be played back actually uses.

CriAtomExVoicePoolHn adxvoice_pool;
CriAtomExVoicePoolHn hcavoice_pool;
/* Create an ADX Voice Pool */
adxvoice_pool = criAtomExVoicePool_AllocateAdxVoicePool(NULL, NULL, 0);
/* Create a HCA Voice Pool */
hcavoice_pool = criAtomExVoicePool_AllocateHcaVoicePool(NULL, NULL, 0);
/* Create a player */
player = criAtomExPlayer_Create(NULL, NULL, 0);
/* Set Cue ID */
criAtomExPlayer_SetCueId(player, acb_hn, CRI_ATOMCUESHEET_THUNDER1);
/* 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)
struct CriAtomExVoicePoolTag * CriAtomExVoicePoolHn
Voice Pool handle.
Definition: cri_le_atom_ex.h:3220
CriAtomExVoicePoolHn criAtomExVoicePool_AllocateAdxVoicePool(const CriAtomExAdxVoicePoolConfig *config, void *work, CriSint32 work_size)
Create an ADX Voice Pool.
CriAtomExVoicePoolHn criAtomExVoicePool_AllocateHcaVoicePool(const CriAtomExHcaVoicePoolConfig *config, void *work, CriSint32 work_size)
Create an HCA Voice Pool.


Note that this method requires large work area since it uses multiple Voice Pools.
When you need to adjust the work size, you can reduce the work size by configuring the number of Voices in the Voice Pool for each codec depending on the number of Cues for the codecs being used.