Audio and Mixers
In Spatial, users have discrete control over various audio categories to match their own audio setup and preferences. This is found in the settings menu of any space in the Spatial app.
Inside Unity this is achieved by using Audio Mixers. As a creator, all sounds you create in a space must be routed through an audio mixer in order for these settings to work, and is required to publish your space.
Guidelines and Requirements
Ultimately Spatial gives you full control of the audio you output to your space. Ears are sensitive and improperly configured audio has the potential to hurt players. Failure to meet the following guidelines may result in your space being removed from the platform.
-
All sounds should be correctly routed to the available categories
Music Background music. Diegetic music can be categorized as “ambience” if you feel it is appropriate. Sound Effects Miscellaneous sounds of “action”, typically lasting at most several seconds. Explosions, slam dunking, and laser beams are all sound effects. Dialogue In-game characters/NPCs talking or narration. This does NOT control voice chat. Ambience The sounds of the environment. Wind blowing and leaves rustling. Interface Sounds from your UI. When you click a button and it makes a satisfying bloop. -
If the user has
Master Volume
set to0%
your space should not produce any sound. -
The Master Volume output should be balanced to a Maximum of
0db
. An average level of about-7db
is ideal.
How to Use the Default Mixer
The Starter Template comes with a simple audio mixer with all the required parameters already exposed.
For every AudioSource
or SpatialSFX
in your project, you will need to assign a mixer group in the inspector. Opening the object selector will give you a nicely organized list of groups you can use. Just select the category you want and you are good to go!
Avoid the Master Group
In the default group you have the option of routing sounds to the Master
group. This will bypass all audio sliders besides the Master Volume
. This could result in a certain sound playing much louder than is comfortable for a user depending on their Spatial and System audio settings, so it is not recommended to do this.
How to Set Up Custom Mixers
The easiest way to create a custom mixer is to duplicate the default Toolkit mixer and do your custom chaining as child groups to the default categories.
Setting Up a Fresh Mixer
If you want to start from scratch or adapt an existing mixer you have you must expose and rename all of the proper volume
parameters. If you don’t expose the parameters properly you will be blocked from uploading.
masterVolume | This should control the output volume of the entire mixer. AKA this should be the exposed volume parameter on the Master group. |
musicVolume | volume parameter of music |
soundEffectsVolume | volume parameter of SFX |
dialogueVolume | volume parameter of dialogue |
ambienceVolume | volume parameter of ambience |
interfaceVolume | volume parameter of interface |
Exposing these parameters links the users audio settings sliders to the volumes of the group you select.