CRI ADX  Last Updated: 2024-07-17 10:47 p
How to Play Back Multiple Voices


There are three methods to play back multiple voices:

Merge multiple sounds into a cue and play back the cue

In CRI Atom Craft, multiple audio waveform data can be entered in a single Cue.
It is possible to create data to play back multiple voices without overlapping each other on the time axis.
It is also possible to create multiple Tracks and create data to play back multiple voices simultaneously on the time axis.
For details, see criatom_tools_tut_mtrk.

Advantages
  • Audio data can be played back at suitable timing with a good balance intended by designers.
  • The program can be very simple because it merely instructs to play back only one Cue.

Disadvantage
  • If audio data cannot be played back as intended, it is necessary to go back to the data creation stage to adjust the data.
    (Because the data can be adjusted by previewing in CRI Atom Craft, it is usually not necessary to adjust data after the data is passed to programmers.)

Send multiple playback requests to a single player

Multiple playback requests can be executed on a single AtomEx Player.
The following code shows a specific example.

/* Create a player */
player = criAtomExPlayer_Create(NULL, NULL, 0);
/* Set a Cue ID and start playback */
criAtomExPlayer_SetCueId(player, acb_hn, CUEID_1);
/* Set a Cue ID and start playback */
criAtomExPlayer_SetCueId(player, acb_hn, CUEID_2);
/* Set a Cue ID and start playback */
criAtomExPlayer_SetCueId(player, acb_hn, CUEID_3);
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
Start the playback.
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)

For details, see the sample program in 'Playback by Cue ID .'
Advantage
  • Playback timing and parameters can be freely adjusted in a program.

Disadvantage
  • Because only one player is used, it is not possible to control each voice during playback.

Create multiple players and send a playback request to each player

The following code shows a concrete example.

/* Playback by player 1 */
player_1 = criAtomExPlayer_Create(NULL, NULL, 0);
criAtomExPlayer_SetCueId(player_1, acb_hn, CUEID_1);
/* Playback by player 2 */
player_2 = criAtomExPlayer_Create(NULL, NULL, 0);
criAtomExPlayer_SetCueId(player_2, acb_hn, CUEID_2);
/* Playback by player 3 */
player_3 = criAtomExPlayer_Create(NULL, NULL, 0);
criAtomExPlayer_SetCueId(player_3, acb_hn, CUEID_3);

Advantages
  • Playback timing and parameters can be freely adjusted in a program.
  • Each voice can be controlled during playback.

Disadvantage
  • The program will be complicated because it is necessary to manage multiple players.

Return:Tips