CRI ADX  Last Updated: 2025-05-07 13:34 p
Spatial audio connection function "3D Transceiver"

Sample directory

/cri/pc/samples/criatomex/control_3d_pos_transceiver

Data used in the sample

/cri/common/smpdata/criatomex/
  • SampleProject.acf
  • AtomCueSheet.acb
  • AtomCueSheet.awb

Sample description

The spatial audio connection function "3D Transceiver" is a function that expands the conventional 3D positioning.
For a detailed explanation of the function, please refer to Spatial audio connection function "3D Transceiver" .
For details on 3D positioning, please refer to the sample: 3D positioning .
To achieve spatial audio expression using a transceiver, the following elements are required.

To set the parameters of the 3D transceiver handle, use the following functions, just like the listener and sound source.

After setting the parameters, use the following function to actually reflect the parameters.

3D regions represent areas in the 3D space of the game. Use the following functions to set listeners, sound sources, and transceivers.
The code for 3D positioning using a 3D transceiver is shown below.
/* Variable declaration */
CriAtomEx3dRegionHn region_a, region_b;
/* Create each object */
listener = criAtomEx3dListener_Create(NULL, NULL, 0);
source = criAtomEx3dSource_Create(NULL, NULL, 0);
transceiver = criAtomEx3dTransceiver_Create(NULL, NULL, 0);
region_a = criAtomEx3dRegion_Create(NULL, NULL, 0);
region_b = criAtomEx3dRegion_Create(NULL, NULL, 0);
/* Set the sound source and listener to the EX player */
player = criAtomExPlayer_Create(NULL, NULL, 0);
/* Setting the Region */
criAtomEx3dTransceiver_Set3dRegionHn(transceiver, region_b);
/* Setting parameters */
pos.x = 0.0f;
pos.y = 0.0f;
pos.z = 0.0f;
:
:
/* Start playback */
id = criAtomExPlayer_Start(player);
:
pos.x += 10.0f;
:
/* Change listener region */
CriAtomEx3dRegionObj * CriAtomEx3dRegionHn
3D region handle
Definition: cri_le_atom_ex.h:4648
CriAtomEx3dRegionHn criAtomEx3dRegion_Create(const CriAtomEx3dRegionConfig *config, void *work, CriSint32 work_size)
Create 3D region handle.
void criAtomEx3dSource_Update(CriAtomEx3dSourceHn ex_3d_source)
Update a 3D sound source.
void criAtomEx3dListener_Set3dRegionHn(CriAtomEx3dListenerHn ex_3d_listener, CriAtomEx3dRegionHn ex_3d_region)
Set 3D region handle for 3D listener handle.
void criAtomEx3dSource_Set3dRegionHn(CriAtomEx3dSourceHn ex_3d_source, CriAtomEx3dRegionHn ex_3d_region)
Set 3D region handle for 3D source handle.
CriAtomEx3dListenerObj * CriAtomEx3dListenerHn
3D listener handle
Definition: cri_le_atom_ex.h:4622
CriAtomEx3dListenerHn criAtomEx3dListener_Create(const CriAtomEx3dListenerConfig *config, void *work, CriSint32 work_size)
Create a 3D listener handle.
void criAtomEx3dTransceiver_Update(CriAtomEx3dTransceiverHn ex_3d_transceiver)
3D Transceiver Update
CriAtomEx3dTransceiverHn criAtomEx3dTransceiver_Create(const CriAtomEx3dTransceiverConfig *config, void *work, CriSint32 work_size)
Create 3D Transceiver handle.
CriAtomEx3dSourceObj * CriAtomEx3dSourceHn
3D sound source handle
Definition: cri_le_atom_ex.h:4596
void criAtomEx3dListener_Update(CriAtomEx3dListenerHn ex_3d_listener)
Update a 3D listener.
void criAtomEx3dSource_SetPosition(CriAtomEx3dSourceHn ex_3d_source, const CriAtomExVector *position)
Set the position of a 3D sound source.
CriAtomEx3dSourceHn criAtomEx3dSource_Create(const CriAtomEx3dSourceConfig *config, void *work, CriSint32 work_size)
Create a 3D sound source.
void criAtomEx3dTransceiver_Set3dRegionHn(CriAtomEx3dTransceiverHn ex_3d_transceiver, CriAtomEx3dRegionHn ex_3d_region)
Setting the 3D region handle for the 3D transceiver handle.
CriAtomEx3dTransceiverObj * CriAtomEx3dTransceiverHn
3D Transceiver handle
Definition: cri_le_atom_ex.h:4676
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_Set3dSourceHn(CriAtomExPlayerHn player, CriAtomEx3dSourceHn source)
Set the 3D sound source handle.
void criAtomExPlayer_Set3dListenerHn(CriAtomExPlayerHn player, CriAtomEx3dListenerHn listener)
Set the 3D listener handle.
3D vector structure
Definition: cri_le_atom_ex.h:4504
CriFloat32 z
Definition: cri_le_atom_ex.h:4507
CriFloat32 y
Definition: cri_le_atom_ex.h:4506
CriFloat32 x
Definition: cri_le_atom_ex.h:4505
Sample program: Scene 1
Sample program: Scene 1 is designed to let sounds from another space, such as a room, leak out from an opening.
Two transceivers are set in the location shown as 3D transceiver in the diagram, with the input and output positions set to the same coordinates, and output the sound sources belonging to the outdoor and indoor regions together.
This is due to the specification that one 3D transceiver is required for each 3D region. As a result, two 3D transceivers are required at the connection between the two spaces.
This sample monitors the listener coordinates, determines whether the 3D listener is outdoors or indoors, and sets the appropriate region to the 3D listener.
The operation of the 3D transceiver is based on the 3D region, so please set the 3D region appropriately in your game program.
/* Listener region switching */
/* Switch region of listener */
if (0.0f < listener->transform.pos.z) {
listener->region_index = 0;
} else {
listener->region_index = 1;
}
criAtomEx3dListener_Set3dRegionHn(listener->hn, s_app_obj->regions[listener->region_index]);


In this sample, crossfading is performed around the 3D transceiver. For information on crossfading, please refer to the Spatial audio connection function "3D Transceiver" page.
Related API
Sample Program: Scene 2
Sample Program: Scene 2 is designed to output a sound from another space to another space by a transceiver.
There is one 3D transceiver, and the 3D transceiver transmits outdoor sounds to an indoor listener.
3D positioning calculations are also performed between the 3D sound source and the 3D transceiver, so you can see that the sound coming from the transceiver output gets quieter as the helicopter sound source moves away.