CRI ADX  Last Updated: 2024-07-17 10:47 p
CriAtomExVoicePool
CriAtomExVoicePool is the module for managing Voices.
This module controls the number of playing voices based on the priorities of the voices to be played back.
The Atom library uses "Voices" to decode audio data or output audio.
When an AtomEx Player is used to play back audio data, it is necessary to create a "Voice Pool" beforehand for Voices suitable for the audio data to be played back.

Creating a Voice Pool

Several functions for creating a Voice Pool are available according to the type of the codec of the audio data to be played back.
For example, it is necessary to use the criAtomExVoicePool_AllocateAdxVoicePool function to create a Voice Pool for ADX playback and the criAtomExVoicePool_AllocateHcaMxVoicePool function to create a Voice Pool for HCA-MX playback.
When a Voice Pool is created, it is necessary to set a configuration structure that specifies the specifications of the Voice Pool and also it is necessary to specify a Working Memory.
For details on creating a Voice Pool, see Tutorials .
[Remarks]
When a Voice Pool is created, the configuration structure can be omitted.
(When it is omitted, the Voice Pool is created in the default settings.)

When a Voice Pool is created successfully, a Voice Pool handle ( CriAtomExVoicePoolHn ) is returned as a return value.
This handle is used to check the usage status of Voices in a Voice Pool or to release a Voice Pool.
A Voice Pool can be used immediately after it is created.
After a Voice Pool is created, when an audio data is played back on an AtomEx Player, Voices in the created Voice Pool are used for the audio playback.
[Note]
If the format of audio data played back on the AtomEx Player is different from the format of the Voice Pool, playback cannot be performed.
Also, if the number of channels or sampling rate of the audio data to be played back is larger than the number of channels or sampling rate of the Voice Pool, playback cannot be performed.
To create a Voice Pool, it is necessary to specify specifications in the configuration structure that are sufficient to play back target audio data.

Destroying a Voice Pool

An unnecessary Voice Pool can be destroyed by using the criAtomExVoicePool_Free function.
By destroying a Voice Pool, the Working Memory that is set when the Voice Pool is created can be used for another purpose or the memory can be released.