ObjectAudioComponent
A Component used to create spatial audio effects in the scene, such as spatial sound effects, spatial music, and so on.
This component takes the audio source's position and orientation into account, and therefore create a more immersive and realistic audio experience.
This component supports only mono (single-channel) audio. It automatically downmixes any multi-channel sources to mono. For best quality and to avoid unintended artifacts, use mono audio whenever possible.
Notes:
Do not add ObjectAudioComponent, AmbientAudioComponent, and ChannelAudioComponent to the same entity simultaneously.
Always add ObjectAudioComponent, AmbientAudioComponent, or ChannelAudioComponent to the entity before calling Entity.prepareAudio or Entity.playAudio.
Constructors
The default constructor for ObjectAudioComponent with no parameters.
Creates a new ObjectAudioComponent with volume, directivity. If volume, directivity is invalid, it will use default value instead to create the ObjectAudioComponent.
Properties
The directivity of the ObjectAudioComponent. The valid value range is ([0.0, 1.0],[0.0, ∞]). The default value is (0.0,0.0). For more information about directivity, refer to Directivity.
The distance attenuation mode for audio.
The reverb volume level of the ObjectAudioComponent. The valid value range is [0.0, 1.0]. The default value is 1.0f.