AudioAnalyzer

Mostrar obsoleto

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.

Resumen

Propiedades

Métodos

Eventos

Propiedades

PeakLevel

Solo lectura
No replicado
Leer paralelo

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

Solo lectura
No replicado
Leer paralelo

The root-mean-square average volume observed during the last audio buffer. This property is generally more stable than PeakLevel but 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 always 0.

SpectrumEnabled

Leer paralelo

Enables usage of GetSpectrum(). If false, GetSpectrum() returns an empty array, but the CPU overhead of the AudioAnalyzer is dramatically reduced. This means that if you are only analyzing the volume of an audio stream, you can disable this property to improve performance.

Leer paralelo

Métodos

GetConnectedWires

Instances

Returns an array of Wires that are connected to the specified pin. AudioAnalyzer has one "Input" pin.

Parámetros

pin: string

Devuelve

Instances

GetInputPins


Devuelve

GetOutputPins


Devuelve

GetSpectrum

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.


Devuelve

Eventos

WiringChanged

Event that fires after a Wire becomes connected or disconnected, and that Wire is now or was previously connected to a pin on the AudioAnalyzer and to some other wirable instance.

Parámetros

connected: bool

Whether the instance got connected or disconnected.

pin: string

The pin on the AudioAnalyzer that the Wire targets.

wire: Wire

The Wire between the AudioAnalyzer and the other instance.

instance: Instance

The other instance that is or was connected through the Wire.