AudioStreamGeneratorPlayback

继承: AudioStreamPlaybackResampled < AudioStreamPlayback < RefCounted < Object

Plays back audio generated using AudioStreamGenerator.

描述

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

方法


方法说明

bool can_push_buffer ( amount: int ) const1

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


void clear_buffer ( )

Clears the audio sample data buffer.


int get_frames_available ( ) const1

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.


int get_skips ( ) const1

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.


bool push_buffer ( frames: PackedVector2Array )

Pushes several audio data frames to the buffer. This is usually more efficient than push_frame in C# and compiled languages via GDExtension, but push_buffer may be less efficient in GDScript.


bool push_frame ( frame: Vector2 )

Pushes a single audio data frame to the buffer. This is usually less efficient than push_buffer in C# and compiled languages via GDExtension, but push_frame may be more efficient in GDScript.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。