Component:RandomAudioClipPlayer: Difference between revisions

From Resonite Wiki
Automated: update SyncDelegates
add info
 
Line 1: Line 1:
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=RandomAudioClipPlayerComponent.png
|Image=RandomAudioClipPlayerComponent.png
|Name=Random Audio Clip Player
|Name=Random Audio Clip Player
}}
}}
Random Audio Clip player is a component that is able to play a random audio file all the way through from a list of <code>Clips</code> and parent the resulting one shots under a slot.
The '''RandomAudioClipPlayer''' component is able to play a random audio file all the way through from a list of <code>Clips</code> and parent the resulting one shots under a slot.


<!--T:2-->
<!--T:2-->
Line 20: Line 19:
{{Table ComponentTriggers
{{Table ComponentTriggers
|Play:[[Type:Action|Action]]|[[Type:Action|Action]]|false| Plays a random audio clip at it's current position
|Play:[[Type:Action|Action]]|[[Type:Action|Action]]|false| Plays a random audio clip at it's current position
|PlayAtPoint:[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]&gt;|[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]&gt;|false|
|PlayAtPoint:[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]&gt;|[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]&gt;|false| Plays a random audio clip at the provided position.
}}
}}



Latest revision as of 21:45, 7 April 2025

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

The RandomAudioClipPlayer component is able to play a random audio file all the way through from a list of Clips and parent the resulting one shots under a slot.

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. Some components stop their functionality when this field is disabled, but some don't.
ParentUnder Slot The slot to parent the one shot objects under.
MinDistance Nullable`1<Float> the distance in meters in the audio's set transform space where the audio's perceived volume stops increasing and stays constant all the way to the center.
MaxDistance Nullable`1<Float> the maximum distance in meters in the audio's set transform space in meters before it cannot be heard.
RolloffMode Nullable`1<AudioRolloffMode> An optional AudioRolloffMode
Clips list of ClipData The list of ClipData to choose from, randomly with weights.

Sync Delegates

Triggers
Method Name Method type and Arguments. Is the method hidden? Description
Play:Action Action X Plays a random audio clip at it's current position
PlayAtPoint:Action`1<Float3> Action`1<Float3> X Plays a random audio clip at the provided position.

Usage

Attach to a slot and give the component some Clips to play. This component can be trigged via it's sync delegates or by button events

Examples

This can be used for boopers, doorbells, or a bike horn.

See Also