ObjectAudioComponent

@MainThread
class ObjectAudioComponent : Component

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:

Constructors

Link copied to clipboard
constructor()

The default constructor for ObjectAudioComponent with no parameters.

constructor(@FloatRange(from = 0.0, to = 1.0) volume: Float = 1.0f, directivity: Directivity = Directivity(0.0f, 0.0f), distanceAttenuationMode: DistanceAttenuationMode = DistanceAttenuationMode.INVERSE_SQUARED, reverbVolume: Float = 1.0f)

Creates a new ObjectAudioComponent with volume, directivity. If volume, directivity is invalid, it will use default value instead to create the ObjectAudioComponent.

Properties

Link copied to clipboard

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.

Link copied to clipboard

The distance attenuation mode for audio.

Link copied to clipboard
var reverbVolume: Float

The reverb volume level of the ObjectAudioComponent. The valid value range is [0.0, 1.0]. The default value is 1.0f.

Link copied to clipboard
var volume: Float

The volume of audio. The valid value range is [0.0, 1.0]. The default value is 1.0f.

Functions

Link copied to clipboard
open override fun clone(): Component

Creates and returns a copy of this Component instance.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String