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

Samples Directory

/CRIWARE/SDK/pc/samples/criatomex/control_pan


Sample Description

You can control orientation of sound by using panning 3D features.
Panning 3D supports interior panning and you can orient the sound image inside the speakers.
For more information on its features, see Panning .

Use the following functions to control orientation from program.

The following is a code to do panning.

CriFloat32 pan3d_angle;
/* Create a player */
player = criAtomExPlayer_Create(NULL, NULL, 0);
/* Set a Cue */
criAtomExPlayer_SetCueName(player, acb_hn, "heli_Loop");
/* Start playback */
/* Play back while changing panning 3D angle */
for(pan3d_angle = -180.0f; pan3d_angle <= 180.0f; pan3d_angle += 0.1f) {
/* Wait for V synchronization */
criFwSys_WaitVsync();
/* Execute the server process */
/* Set the panning 3D angle */
criAtomExPlayer_SetPan3dAngle(player, pan3d_angle);
/* Update */
}
void criAtomEx_ExecuteMain(void)
Execute the server processing.
void criAtomExPlayer_SetPan3dAngle(CriAtomExPlayerHn player, CriFloat32 pan3d_angle)
Set the panning 3D angle.
void criAtomExPlayer_SetCueName(CriAtomExPlayerHn player, CriAtomExAcbHn acb_hn, const CriChar8 *cue_name)
Set the sound data to play (specifying a Cue name)
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
Start the playback.
CriAtomExPlayerObj * CriAtomExPlayerHn
Player handle.
Definition: cri_le_atom_ex.h:3622
void criAtomExPlayer_UpdateAll(CriAtomExPlayerHn player)
Update the playback parameters (for all sounds currently playing)
CriAtomExPlayerHn criAtomExPlayer_Create(const CriAtomExPlayerConfig *config, void *work, CriSint32 work_size)
Create an AtomEx player.