Component:AudioClipPlayer: Difference between revisions

From Resonite Wiki
Automated: update Categories, SyncDelegates
Add Sync delegate description
 
(One intermediate revision by the same user not shown)
Line 16: Line 16:
== Sync Delegates ==
== Sync Delegates ==
{{Table ComponentTriggers
{{Table ComponentTriggers
|Play()|[[Type:Action|Action]]|
|Play()|[[Type:Action|Action]]| When called, starts playback for this component.
|Stop()|[[Type:Action|Action]]|
|Stop()|[[Type:Action|Action]]| When called, stops playback for this component.
|Pause()|[[Type:Action|Action]]|
|Pause()|[[Type:Action|Action]]| When called, pauses playback for this component.
|Resume()|[[Type:Action|Action]]|
|Resume()|[[Type:Action|Action]]| When called, resumes playback for this component.
}}
}}


Line 34: Line 34:
</translate>
</translate>
[[Category:Components{{#translation:}}|Audio Clip Player]]
[[Category:Components{{#translation:}}|Audio Clip Player]]
[[Category:ComponentStub]]
[[Category:Components:Audio{{#translation:}}|Audio Clip Player]]
[[Category:Components:Audio{{#translation:}}|Audio Clip Player]]

Latest revision as of 22:34, 7 November 2024

Component image 
Audio Clip Player component as seen in the Scene Inspector


Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
playback direct SyncPlayback The playback object that includes data about playtime, duration, position, and playspeed of the audio.
Clip AudioClip The AudioClip to play. This can be a StaticAudioClip.

Sync Delegates

Triggers
Name Arguments Description
Play() Action When called, starts playback for this component.
Stop() Action When called, stops playback for this component.
Pause() Action When called, pauses playback for this component.
Resume() Action When called, resumes playback for this component.

Usage

Add an audio clip to the Clip field by holding a default audio clip player and clicking. then put the Audio Clip Player into an Audio Output and hit play to hear the audio.

Examples

This is usually used in in-game audio players like radios, vehicles, and default audio clip players to play audio constantly. It can be used to play audio and be able to scrub the audio without worrying about working with one shots which play all the way through.

Related Components