Protected
constructorThe audio asset currently assigned to play.
Readonly
durationThe length (in seconds) of the current sound assigned to play.
If disabled, the Component will stop enacting its behavior.
Length (in seconds) of a volume fade in applied to the beginning of sound playback.
Length (in seconds) of a volume fade out applied to the end of sound playback.
When true, records sound directly into the snap. This mode works only when all Audio Components in the scene are using mix to snap. In this case input from microphone will be ignored.
Wearable Only
playbackHow the audio should be played back. Useful in optimizing audio in Spectacles.
The current playback time in seconds
The volume of audio recorded to the snap, from 0 to 1.
Readonly
sceneThe scene object this component is on.
Readonly
spatialSpatial Audio settings.
Readonly
uniqueA volume multiplier for any sounds played by this AudioComponent.
Destroys the component.
Returns the SceneObject the component is attached to.
Returns the Transform this component is attached to.
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns whether the sound is currently paused.
Returns whether the AudioComponent is currently playing sound.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
Pauses the sound.
Plays the current sound loops
number of times. If loops
is -1, the sound will repeat forever.
Resumes a paused sound.
Sets the callback function to be called whenever this sound stops playing.
Stops the current sound if already playing.
Used to play audio in a Lens.
Remarks
You can assign an AudioTrackAsset to play through script, or through the Audio Component input in the Inspector panel of Lens Studio.
See
Playing Audio guide for more information.
Example