- 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.
-
- 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.
- Disable the "Mute Other Audio" flag on the asset.
- 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(){
atomExPlayer = new CriAtomExPlayer(128, 1);
atomExVoicePool = new CriAtomExWaveVoicePool(1, 2, 48000, true, 0);
atomEx3DSource = new CriAtomEx3dSource();
atomEx3DSource.SetMinMaxDistance(0.0f, 10.0f);
atomEx3DSource.Update();
atomExPlayer.Set3dSource(atomEx3DSource);
atomExPlayer.Set3dListener(atomEx3DListener);
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.
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.