CRIWARE Unity Plugin Manual  Last Updated: 2025-05-08
ADX Tips
This section provides useful information to use ADX with Unity.

Disabling Unity's standard audio

In Unity 4.2 or later, the Disable Audio property has been added to the Audio settings of a project. You can use it to disable Unity's standard audio.
If you use ADX and do not use Unity's standard audio, you can also disable it. It may reduce the CPU load and the memory usage of the application.
cri4u_tips_adx2_disable_unity_audio_menu.png

cri4u_tips_adx2_disable_unity_audio_inspector.png

On some platforms, it is mandatory to enable the above-mentioned "Disable Unity Audio" when using ADX audio output.
Therefore, when you deploy the CRIWARE Unity Plugin and build your application, this flag will be forcibly enabled (for Unity 5.6 and above) except for some platforms.

Enable Unity standard audio

If you want to use any Unity standard audio function such as standard microphone input, please follow the procedure below to prevent the above-mentioned flag from being update by the plugin.

  • Create CriWareBuildPreProcessorPrefs.asset from the Unity Editor menu.
    cri4u_tips_adx2_enable_unity_audio_menu.png

  • Disable the "Mute Other Audio" flag on the asset.
    cri4u_tips_adx2_enable_unity_audio_inspector.png

  • In the project's Audio settings (Edit> Project Settings> Audio), uncheck "Disable Unity Audio".

Notes on playing WAV, PCM, and audio-only 3D positioning

When playing audio files such as WAV, there is no playback information for 3D positioning, so additional settings are required during playback.
In addition to creating a player and voice pool for playing audio files, you will also need to create a 3D sound source.
Please refer to the sample code below.

CriAtomExPlayer atomExPlayer;
CriAtomExVoicePool atomExVoicePool;
CriAtomEx3dSource atomEx3DSource;
private void Awake(){
/* Create a player and voice pool for playing a single file */
atomExPlayer = new CriAtomExPlayer(128, 1);
atomExVoicePool = new CriAtomExWaveVoicePool(1, 2, 48000, true, 0);
/* Create and set 3D sound source */
atomEx3DSource = new CriAtomEx3dSource();
atomEx3DSource.SetMinMaxDistance(0.0f, 10.0f);
atomEx3DSource.Update();
/* Set the player's 3D positioning components */
atomExPlayer.Set3dSource(atomEx3DSource);
atomExPlayer.Set3dListener(atomEx3DListener);
/* Set the pan type for the player */
atomExPlayer.SetPanType(CriAtomEx.PanType.Pos3d);
}

Place a "CRI Atom Listener" component in the scene and use it as a 3D listener.
After completing the steps above to prepare for playback, set up the file and play it as you normally would.
Please update the coordinates of the 3D sound source when necessary, such as by using Update.

translated_by_Google.png

THIS SERVICE MAY CONTAIN TRANSLATIONS POWERED BY GOOGLE. GOOGLE DISCLAIMS ALL WARRANTIES RELATED TO THE TRANSLATIONS, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF ACCURACY, RELIABILITY, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.