Inheritance #

RefCounted

- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader

Table of contents

AudioStreamPlayback #

is_refcounted, is_instantiable, core, not_builtin_classes

Meta class for playing back audio.

Can play, loop, pause a scroll through audio. See AudioStream and AudioStreamOggVorbis for usage.

Members #

Methods #

virtual const func _get_loop_count() -> int#

Overridable method. Should return how many times this audio stream has looped. Most built-in playbacks always return 0.

virtual const func _get_parameter(name: StringName) -> Variant#

Return the current value of a playback parameter by name (see AudioStream._get_parameter_list).

virtual const func _get_playback_position() -> float#

Overridable method. Should return the current progress along the audio stream, in seconds.

virtual const func _is_playing() -> bool#

Overridable method. Should return true if this playback is active and playing its audio stream.

virtual func _mix(frames: int) -> int#

Override this method to customize how the audio stream is mixed. This method is called even if the playback is not active.

Note: It is not useful to override this method in GDScript or C#. Only GDExtension can take advantage of it.

virtual func _seek(position: float) -> void#

Override this method to customize what happens when seeking this audio stream at the given position, such as by calling AudioStreamPlayer.seek.

virtual func _set_parameter(value: Variant) -> void#

Set the current value of a playback parameter by name (see AudioStream._get_parameter_list).

virtual func _start(from_pos: float) -> void#

Override this method to customize what happens when the playback starts at the given position, such as by calling AudioStreamPlayer.play.

virtual func _stop() -> void#

Override this method to customize what happens when the playback is stopped, such as by calling AudioStreamPlayer.stop.

virtual func _tag_used_streams() -> void#

Overridable method. Called whenever the audio stream is mixed if the playback is active and AudioServer.set_enable_tagging_used_audio_streams has been set to true. Editor plugins may use this method to "tag" the current position along the audio stream and display it in a preview.

const func get_loop_count() -> int#

Returns the number of times the stream has looped.

const func get_playback_position() -> float#

Returns the current position in the stream, in seconds.

const func get_sample_playback() -> AudioSamplePlayback#

Returns the AudioSamplePlayback associated with this AudioStreamPlayback for playing back the audio sample of this stream.

const func is_playing() -> bool#

Returns true if the stream is playing.

func mix_audio(frames: int) -> PackedVector2Array#

Mixes up to frames of audio from the stream from the current position, at a rate of rate_scale, advancing the stream.

Returns a PackedVector2Array where each element holds the left and right channel volume levels of each frame.

Note: Can return fewer frames than requested, make sure to use the size of the return value.

func seek(time: float = 0.0) -> void#

Seeks the stream at the given time, in seconds.

func set_sample_playback(playback_sample: AudioSamplePlayback) -> void#

Associates AudioSamplePlayback to this AudioStreamPlayback for playing back the audio sample of this stream.

func start(from_pos: float = 0.0) -> void#

Starts the stream from the given from_pos, in seconds.

func stop() -> void#

Stops the stream.

Annotations #

Constants #

Constructors #

Enums #

Operators #

Signals #

Theme Items #

Tutorials #