# Audio system

The audio system of the mini game is based on W3C WebAudio and is designed for game audio. Compared with Basic Audio Interface, it has better performance and more complete functions. Features include 3D spatial sound effects, real-time mixing, mixer hierarchy views, snapshots, preset sound effects, and more.


# working principle

In order to simulate the effect of location on the sound, the audio system requires that the sound must come from the [Audio Source AudioSource component] (./audioSource.md) attached to the node. The sound emitted by the AudioSource will be received by the audio listener AudioListener attached to another object (usually the main camera), and the audio system can simulate the distance between the audio source and the monitor. The effect of location on audio.

The audio system cannot calculate the echo based on the geometry of the scene, but we can add sound effect component to the node where the AudioSource or AudioListener is located, so that the sound effect component can act on the AudioSource or AudioListener to simulate various desires. Sound effects.

By default, the sound emitted by AudioSource will be directly received by AudioListener. But we can specify the audio mixing group AudioMixerGroup for AudioSource, so that the sound emitted by AudioSource will be mixed in real time through AudioMixer, and then output to AudioListener.


# Supported format

Refer to the supported audio resource format.

点击咨询小助手