Map Audio - naelstrof/ChurnVectorSDK GitHub Wiki

This document aims to cover audio topics such as reverb zones, scene ambience and point sounds.

Point sounds (aka Environment Audio Sources)

To start this off we first need an Audio Source component with a clip in it that we want to be playing constantly in the world as some kind of ambient sound like an engine running or a computer crunching its hard drive.

audioexample2

Important: Note that the Output is set to SoundEffect(Master). This is what enables players to turn this sound down in their audio settings. You should ideally never not have this set to SoundEffects as the other audio options are for world and game audio.

Also you should always have Spacial Blend set to 3D if you want the sound to actually come from somewhere.

In CV we have our own custom script for handling audio sources which automatically enables and disables them based on the players distance to the audio point. This prevents popping from sources clipping as they reach their falloff distance and allows you to have a very large number of them without causing performance hitches in players on lower end machines.

This script is called "EnvironmentAudioSource" and works with the AudioSource component.

To make use of this, all you need to do is attach the script to the same element as the audio source and disable said source. The end result should look like this:

soundexample1

Just make sure that if you use the Logarithmic rolloff for your audio source, that the final value ends at 0 on the verticle axis or you may still encounter popping issues as the player moves out of range of the sound.

World Ambience

This is as simple as an Audio source that does not have the above script attached, is enabled from the start, is set to the Ambience Ouput and has its spacial blend set to 2d. Thats it, thats the world audio setup we use. Just make sure the volume is very low, something like 0.15 so that it doesn't drown out anything else that happens to share the same priority as it.

Reverb zones

This is best covered in full by a video on youtube or the official Unity documentation as this is a very large topic. If you want to you can simply never add these to your map however it makes things sound significantly better when different rooms echo differently to others.