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

Sample directory

/cri/pc/samples/criatomex/playback_awb

Data used in the sample

/cri/common/smpdata/criatomex/
  • SampleAdxPack.awb

Sample description

CRI Atom allows you to play audio data directly from an AWB file.
The code to stream audio data from an AWB file is shown below.
CriAtomExAdxVoicePoolConfig voice_pool_config;
CriAtomAwbHn awb_hn;
/* Create an AWB handle */
awb_hn = criAtomAwb_LoadToc(NULL, PATH AWB_FILE, NULL, 0);
/* Initialize parameters for creating Voice Pool with default value */
/* Enable streaming playback because we want to play back from AWB file in streaming */
voice_pool_config.player_config.streaming_flag = CRI_TRUE;
/* Create a Voice Pool which allows streaming playback */
voice_pool = criAtomExVoicePool_AllocateAdxVoicePool(&voice_pool_config, NULL, 0);
/* Create a player */
player = criAtomExPlayer_Create(NULL, NULL, 0);
/* Set WaveID */
criAtomExPlayer_SetWaveId(player, awb_hn, 0);
/* Start playback */
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
Start the playback.
CriAtomExPlayerObj * CriAtomExPlayerHn
Player handle.
Definition: cri_le_atom_ex.h:3622
void criAtomExPlayer_SetWaveId(CriAtomExPlayerHn player, CriAtomAwbHn awb, CriAtomExWaveId id)
Set the wave data to play (specifying a wave data ID)
CriAtomExPlayerHn criAtomExPlayer_Create(const CriAtomExPlayerConfig *config, void *work, CriSint32 work_size)
Create an AtomEx player.
#define criAtomExVoicePool_SetDefaultConfigForAdxVoicePool(p_config)
Assign the default values to the configuration structure used to create an ADX Voice Pool.
Definition: cri_le_atom_ex.h:582
CriAtomExVoicePoolHn criAtomExVoicePool_AllocateAdxVoicePool(const CriAtomExAdxVoicePoolConfig *config, void *work, CriSint32 work_size)
Create an ADX Voice Pool.
struct CriAtomAwbTag * CriAtomAwbHn
AWB handle.
Definition: cri_le_atom.h:1349
CriAtomAwbHn criAtomAwb_LoadToc(CriFsBinderHn binder, const CriChar8 *path, void *work, CriSint32 work_size)
Load AWB file's TOC information (synchronous version)
CriBool streaming_flag
Whether to perform streaming playback.
Definition: cri_le_atom.h:1641
Configuration structure used when creating an ADX Voice Pool.
Definition: cri_le_atom_ex.h:3277
CriAtomAdxPlayerConfig player_config
Definition: cri_le_atom_ex.h:3280


The third argument of the criAtomExPlayer_SetWaveId function is an index of the sound data in the AWB file.


The above code example is for streaming playback, but on-memory playback is also possible by loading the AWB file into memory and using the criAtomAwb_LoadFromMemory function to create an AWB handle from the AWB file image.