Table of Contents

Class AudioEffectCapture

Namespace
Godot
Assembly
GodotSharp.dll

AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer.

Application code should consume these audio frames from this ring buffer using GetBuffer(int) and process it as needed, for example to capture data from an AudioStreamMicrophone, implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating point PCM.

Note: ProjectSettings.audio/driver/enable_input must be true for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.

public class AudioEffectCapture : AudioEffect, IDisposable
Inheritance
AudioEffectCapture
Implements
Inherited Members

Constructors

AudioEffectCapture()

public AudioEffectCapture()

Properties

BufferLength

Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized.

public float BufferLength { get; set; }

Property Value

float

Methods

CanGetBuffer(int)

Returns true if at least frames audio frames are available to read in the internal ring buffer.

public bool CanGetBuffer(int frames)

Parameters

frames int

Returns

bool

ClearBuffer()

Clears the internal ring buffer.

public void ClearBuffer()

GetBuffer(int)

Gets the next frames audio samples from the internal ring buffer.

Returns a Vector2[] containing exactly frames audio samples if available, or an empty Vector2[] if insufficient data was available.

public Vector2[] GetBuffer(int frames)

Parameters

frames int

Returns

Vector2[]

GetBufferLengthFrames()

Returns the total size of the internal ring buffer in frames.

public int GetBufferLengthFrames()

Returns

int

GetDiscardedFrames()

Returns the number of audio frames discarded from the audio bus due to full buffer.

public long GetDiscardedFrames()

Returns

long

GetFramesAvailable()

Returns the number of frames available to read using GetBuffer(int).

public int GetFramesAvailable()

Returns

int

GetPushedFrames()

Returns the number of audio frames inserted from the audio bus.

public long GetPushedFrames()

Returns

long

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool