Spatializing Sound Sources
Follow these steps to set up the spatial audio rendering pipeline as shown in the Signal Flow section.
1. Select the atmoky Spatializer Plugin
If you haven't done so already during installation, go to Edit -> Project Settings -> Audio
and select atmokySpatializer under Spatializer Plugin
.
This will make sure that the spatializer plug-in is used for all audio sources that have the Spatialize
tick box set.
2. Create a Mixer
The atmokySpatializer plug-in does not output any signals per se, but sends its audio output to a particular atmokyRenderer instance, which has to be inserted into a Mixer Group.
You can create a Mixer via Assets -> Create -> Audio Mixer
and optionally Mixer Groups for sub-mixing.
3. Add an atmoky Renderer Plugin
Add an atmokyRenderer plug-in to each sub-mix you want to render separately by right clicking the bus and choosing Add effect at top -> atmokyRenderer
.
When clicking on the Mixer Group, you can now see the atmokyRenderer plug-in in the Inspector exhibiting the parameters Ext. Amount, Ext. Character, and Renderer Index.
For each atmokyRenderer instance, you have to assign a unique non-zero Renderer Index
such that a atmokySpatializer plug-in can send its audio output to the correct atmokyRenderer instance.
The renderer index
is 0 per default (such that the renderer plug-in is muted). To unmute an instance, you have to assign a unique non-zero renderer index
.
Note that if two renderer instances use the same index, both will be muted. By clicking "Next available renderer" the next unused index will be assigned.
4. Spatialize an Audio Source
- Add one or several AudioSource(s) to your scene
- Set the
Spatialize
tick box of the AudioSource - Set the
Spatial Blend
to 1, meaning 3D rendering - Route the
Output
of the AudioSource to a bus equipped with the atmokyRenderer plug-in - Select the corresponding
Renderer Index
: You can do that programmatically or via the Inspector by using theatmokySource.cs
script (Add Component
-> Atmoky Source), which exposes therenderer index
as a public variable.
Per default, the atmokySpatializer sends its audio to the renderer instance with index 1. So if you have only one renderer instance, you don't have to change anything on the spatializer side.