Table of Contents

Class AudioStreamGeneratorPlayback

Namespace
Godot
Assembly
GodotSharp.dll

This class is meant to be used with AudioStreamGenerator to play back the generated audio in real-time.

public class AudioStreamGeneratorPlayback : AudioStreamPlaybackResampled, IDisposable
Inheritance
AudioStreamGeneratorPlayback
Implements
Inherited Members

Methods

CanPushBuffer(int)

Returns true if a buffer of the size amount can be pushed to the audio sample data buffer without overflowing it, false otherwise.

public bool CanPushBuffer(int amount)

Parameters

amount int

Returns

bool

ClearBuffer()

Clears the audio sample data buffer.

public void ClearBuffer()

GetFramesAvailable()

Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is 0, the buffer is full.

public int GetFramesAvailable()

Returns

int

GetSkips()

Returns the number of times the playback skipped due to a buffer underrun in the audio sample data. This value is reset at the start of the playback.

public int GetSkips()

Returns

int

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

PushBuffer(Vector2[])

Pushes several audio data frames to the buffer. This is usually more efficient than PushFrame(Vector2) in C# and compiled languages via GDExtension, but PushBuffer(Vector2[]) may be less efficient in GDScript.

public bool PushBuffer(Vector2[] frames)

Parameters

frames Vector2[]

Returns

bool

PushFrame(Vector2)

Pushes a single audio data frame to the buffer. This is usually less efficient than PushBuffer(Vector2[]) in C# and compiled languages via GDExtension, but PushFrame(Vector2) may be more efficient in GDScript.

public bool PushFrame(Vector2 frame)

Parameters

frame Vector2

Returns

bool