🔊Volume
Last updated
Last updated
We often encounter two types of volume units in Unity and BroAudio, both relative to the original audio file's volume:
Normalized Volume: When set to 1, it represents 100% of the file's original volume, while 0 represents 0% volume, which means complete silence. Unity's AudioSource volume uses this unit.
Decibel Volume (dB): This is the most commonly used unit to describe volume. It represents a logarithmic value. When set to 0dB, it means no changes to the file's original volume (so 0dB = 1 normalized volume). Unity's AudioMixer uses this unit. Decibel(dB) Wikipedia
Decibel (dB) is a relative unit, so different reference objects and ranges can lead to different calculations. However, here we are referring to dBFS, which uses the original volume of the audio file as its Full Scale.
These two volume units can be converted into each other. Although you don't need to do the calculations yourself, if you are interested, the formula is as follows:
(V1/V2) is the same as Normalized Volume. There are many simple online calculators available for use. By entering the Normalized Volume into the Voltage Gain, you can convert it to dB.
In BroAudio, every sound plays through the Audio Mixer, with a volume range of 0 to 10 (-80dB to +20dB). This is 20dB more than what Audio Source offers, meaning you can produce sounds louder than the original files. This feature helps you to easily adjust and balance the overall volume.
Volume range will be limited to 0~1 (-80dB~0dB) in WebGL, more details.
The volume slider is based on decibel value; it's a logarithmic slider instead of a linear slider like Audio Source's volume. This matches human sound perception better and allows for easier fine-tuning.
To further ensure precision, most audio software, including Unity Audio Mixer, features custom scale settings. Below is a comparison of different slider types, with each measured in decibels(dB) :
There are three volume settings available in BroAudio, and they all work in conjunction.
Master Volume (of the entity)
SetVolume(API)
The final playback volume (in normalized) will be
Clip Volume * Entity Master Volume * SetVolume(if it's implemented)