Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- 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
-
virtual const func _get_loop_count() -> int -
virtual const func _get_parameter(name: StringName) -> Variant -
virtual const func _get_playback_position() -> float -
virtual const func _is_playing() -> bool -
virtual func _mix(frames: int) -> int -
virtual func _seek(position: float) -> void -
virtual func _set_parameter(value: Variant) -> void -
virtual func _start(from_pos: float) -> void -
virtual func _stop() -> void -
virtual func _tag_used_streams() -> void -
const func get_loop_count() -> int -
const func get_playback_position() -> float -
const func get_sample_playback() -> AudioSamplePlayback -
const func is_playing() -> bool -
func mix_audio(frames: int) -> PackedVector2Array -
func seek(time: float = 0.0) -> void -
func set_sample_playback(playback_sample: AudioSamplePlayback) -> void -
func start(from_pos: float = 0.0) -> void -
func stop() -> void
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.