Component:RandomAudioClipPlayer: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page RandomAudioClipPlayer (Component) to Component:RandomAudioClipPlayer: Creating component Namespace
Automated: update Replace
 
(5 intermediate revisions by 2 users not shown)
Line 5: Line 5:
|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.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|MinDistance|Nullable`1|TypeString0=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.
|ParentUnder|Slot| The slot to parent the one shot objects under.
|MaxDistance|Nullable`1|TypeString1=Float?| the maximum distance in meters in the audio's set transform space in meters before it cannot be heard.
|MinDistance|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float|Float]]&gt;'''|TypeAdv1=true| 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.
|RolloffMode|Nullable`1|TypeString2=Nullable<AudioRolloffMode>| An optional [[Type:AudioRolloffMode|AudioRolloffMode]]
|MaxDistance|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float|Float]]&gt;'''|TypeAdv2=true| the maximum distance in meters in the audio's set transform space in meters before it cannot be heard.
|Clips|SyncList`1|TypeString3=SyncList<ClipData>| The list of [[Type:ClipData|ClipData]] to choose from, randomly with weights.
|RolloffMode|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:AudioRolloffMode|AudioRolloffMode]]&gt;'''|TypeAdv3=true| An optional [[Type:AudioRolloffMode|AudioRolloffMode]]
|Clips|{{RootFieldType|SyncList`1|[[Type:ClipData|ClipData]]}}|TypeAdv4=true| The list of [[Type:ClipData|ClipData]] to choose from, randomly with weights.
}}
 
== Sync Delegates ==
{{Table ComponentTriggers
|Play()|[[Type:Action|Action]]|
|PlayAtPoint()|[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]: point&gt;|
}}
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
{{stub}}
Attach to a slot and give the component some <code>Clips</code> to play. This component can be trigged via it's [[Sync Delegate|sync delegates]] or by [[Button Events|button events]]


<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
{{stub}}
This can be used for boopers, doorbells, or a bike horn.


[[Category:Components:Media{{#translation:}}|Random Audio Clip Player]]
[[Category:ComponentStubs]]
[[Category:ComponentStubs]]
[[Category:Components|Random Audio Clip Player]]
[[Category:Components{{#translation:}}|Random Audio Clip Player]]
[[Category:Components:Media|Random Audio Clip Player]]

Latest revision as of 21:06, 6 November 2024


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


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

Random Audio Clip player is a component that 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.
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. Description
Play() Action
PlayAtPoint() Action`1<Float3: point>

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.