AudioStreamGeneratorPlayback
Plays back audio generated using AudioStreamGenerator
.
class AudioStreamGeneratorPlayback
This class is meant to be used with AudioStreamGenerator
to play back the generated audio in real-time.
Superclasses
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func canPushBuffer(amount: Int32
) -> Bool Returns
true
if a buffer of the sizeamount
can be pushed to the audio sample data buffer without overflowing it,false
otherwise.func clearBuffer(
) Clears the audio sample data buffer.
func getFramesAvailable(
) -> Int32 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.func getSkips(
) -> Int32 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.
func pushBuffer(frames: PackedVector2Array
) -> Bool Pushes several audio data frames to the buffer. This is usually more efficient than
pushFrame(_:)
in C# and compiled languages via GDExtension, butpushBuffer(frames:)
may be less efficient in GDScript.func pushFrame(Vector2
) -> Bool Pushes a single audio data frame to the buffer. This is usually less efficient than
pushBuffer(frames:)
in C# and compiled languages via GDExtension, butpushFrame(_:)
may be more efficient in GDScript.