Component:VolumeMeter: Difference between revisions

From Resonite Wiki
Still missing Meter method
missing image slot
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:


{{Infobox Component
|Image=VolumeMeterComponent.png
|Name=Volume Meter
}}
The '''VolumeMeter''' component can be used to get the volume of an inputted audio source.
The '''VolumeMeter''' component can be used to get the volume of an inputted audio source.


Line 6: Line 10:
|Smoothing|Float| how much to smooth lerp the <code>Volume</code> field output.
|Smoothing|Float| how much to smooth lerp the <code>Volume</code> field output.
|Power|Float| the range of the <code>Volume</code> field from 0 to this.
|Power|Float| the range of the <code>Volume</code> field from 0 to this.
|Method|VolumeMeterMethod|
|Method|VolumeMeterMethod| Whether the outputted value should be the current volume, or the change in volume over time (delta)
|Source|IAudioSource| the audio source to read the volume of in real time as long as it's streaming or playing.
|Source|IAudioSource| the audio source to read the volume of in real time as long as it's streaming or playing.
|Volume|{{RootFieldType|RawOutput`1|[[Type:Float|Float]]}}|TypeAdv4=true| The current volume of <code>Source</code> after smoothing factor of <code>Smoothing</code>
|Volume|{{RootFieldType|RawOutput`1|[[Type:Float|Float]]}}|TypeAdv4=true| The current volume of <code>Source</code> after smoothing factor of <code>Smoothing</code>
Line 20: Line 24:
* [[Component:TalkVisualizer|TalkVisualizer]]
* [[Component:TalkVisualizer|TalkVisualizer]]


[[Category:ComponentStub]]
[[Category:Components{{#translation:}}|Volume Meter]]
[[Category:Components{{#translation:}}|Volume Meter]]
[[Category:Components:Media:Utility{{#translation:}}|Volume Meter]]
[[Category:Components:Media:Utility{{#translation:}}|Volume Meter]]

Latest revision as of 14:29, 20 October 2024

Component image 
File:VolumeMeterComponent.png
Volume Meter component as seen in the Scene Inspector

The VolumeMeter component can be used to get the volume of an inputted audio source.

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.
Smoothing Float how much to smooth lerp the Volume field output.
Power Float the range of the Volume field from 0 to this.
Method VolumeMeterMethod Whether the outputted value should be the current volume, or the change in volume over time (delta)
Source IAudioSource the audio source to read the volume of in real time as long as it's streaming or playing.
Volume raw output of Float The current volume of Source after smoothing factor of Smoothing

Usage

Attach to a slot and provide any IAudioSource to Source. When audio data is being generated by Source the Volume field will start changing values.

Examples

This is used in avatars that flash when talking, or in audio visualizers

See Also