Adding spatial audio with 3D audio sources
3D audio sources play sound that is perceived to be coming from a specific location in the 3D game world. This includes information about the direction and distance of the source, which affects how the sound is perceived by the listener. An Audio Listener
component must also be present in the scene. Typically, this is attached to the main camera or the player character. The audio listener acts as the ears of the player, receiving sounds from the audio sources in the scene and outputting them to the player’s speakers or headphones. For example, a sound that is further away from the audio listener will be quieter, and one that is to the left of the listener will be heard more prominently in the left ear. For 2D audio, it doesn’t matter where the audio listener is in the scene because 2D audio does not compute distance and therefore will have a consistent volume level across the scene for the audio source.
By using 3D audio sources...