Class · inherits Instance
AudioAnalyzer
Takes measurements from audio streams that are connected to it via one or more
Wires.
About AudioAnalyzer
AudioAnalyzer takes measurements from audio streams that are wired to
it through Wire. It provides a single Input pin but does not
produce any output streams. Note that all audio processing is disabled on the
server in order to conserve resources; Properties and methods of
AudioAnalyzer return empty or zero results when used from server
scripts.
Properties 4
PeakLevel
: floatReadOnlyNotReplicatedThe loudest volume observed during the last audio buffer.The loudest volume observed during the last audio buffer. This property changes more often than the framerate and does not fire changed events. On the server, this property is always
0.RmsLevel
: floatReadOnlyNotReplicatedThe root-mean-square average volume observed during the last audio buffer.The root-mean-square average volume observed during the last audio buffer. This property is generally more stable than
PeakLevelbut it may not capture momentary volume spikes. This property changes more often than the framerate and does not fire changed events. On the server, this property is always0.SpectrumEnabled
: booleanEnables usage ofGetSpectrum.Enables usage of
GetSpectrum(). Iffalse,GetSpectrum()returns an empty array, but the CPU overhead of theAudioAnalyzeris dramatically reduced. This means that if you are only analyzing the volume of an audio stream, you can disable this property to improve performance.WindowSize
: AudioWindowSizeControls the resolution and timeliness ofGetSpectrum.Controls the size of arrays returned by
GetSpectrum(). Larger windows contain more data (so more-accurate frequency responses) but change less often.
Methods 4
GetConnectedWires
(pin: string) → List<Wire>Returns an array ofWiresthat are connected to the specified pin.Returns an array of
Wiresthat are connected to the specified pin.AudioAnalyzerhas one "Input" pin.GetInputPins
() → ArrayGets the list of pins thatWirecan use inWire.TargetNameto connect to this instance via itsWire.TargetInstanceproperty.Gets the list of pins that
Wirecan use inWire.TargetNameto connect to this instance via itsWire.TargetInstanceproperty.For
AudioAnalyzer, this isInputonly.GetOutputPins
() → ArrayGets the list of pins thatWirecan use inWire.SourceNameto connect to this instance via itsWire.SourceInstanceproperty.Gets the list of pins that
Wirecan use inWire.SourceNameto connect to this instance via itsWire.SourceInstanceproperty.For
AudioAnalyzer, there are none.GetSpectrum
() → ArrayReturns the frequency spectrum of the last audio buffer.Returns the frequency spectrum of the last audio buffer, as an array of numbers. The elements of the array are root-mean-square volume levels, evenly spaced from 0 hertz to 24,000 hertz. If any of the analyzer's inputs come from an
AudioDeviceInput, or this method is used from a server script, it returns an empty array.
Events 1
WiringChanged
AudioAnalyzer.WiringChanged:Connect(function(connected, pin, wire, instance))Fires when another instance is connected to or disconnected from theAudioAnalyzervia aWire.Event that fires after a
Wirebecomes connected or disconnected, and thatWireis now or was previously connected to a pin on theAudioAnalyzerand to some other wirable instance.
AudioAnalyzer also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.