Documentation
¶
Overview ¶
Package AudioStreamPlayback provides methods for working with AudioStreamPlayback object instances.
Index ¶
- type Advanced
- type Any
- type AudioFrame
- type Expanded
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AsAudioStreamPlayback() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) GetLoopCount() int
- func (self Instance) GetPlaybackPosition() Float.X
- func (self Instance) GetSamplePlayback() AudioSamplePlayback.Instance
- func (self Instance) ID() ID
- func (self Instance) IsPlaying() bool
- func (self Instance) MixAudio(rate_scale Float.X, frames int) []Vector2.XY
- func (self Instance) SeekTo()
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetSamplePlayback(playback_sample AudioSamplePlayback.Instance)
- func (self Instance) Start()
- func (self Instance) Stop()
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type AudioFrame ¶
type AudioFrame = gd.AudioFrame
type Expanded ¶
type Expanded [1]gdclass.AudioStreamPlayback
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsAudioStreamPlayback ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.AudioStreamPlayback
Can play, loop, pause a scroll through audio. See [AudioStream] and [AudioStreamOggVorbis] for usage.
See [Interface] for methods that can be overridden by a [Class] that extends it.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsAudioStreamPlayback ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) GetLoopCount ¶
Returns the number of times the stream has looped.
func (Instance) GetPlaybackPosition ¶
Returns the current position in the stream, in seconds.
func (Instance) GetSamplePlayback ¶
func (self Instance) GetSamplePlayback() AudioSamplePlayback.Instance
Returns the [AudioSamplePlayback] associated with this [AudioStreamPlayback] for playing back the audio sample of this stream.
func (Instance) MixAudio ¶
Mixes up to [param frames] of audio from the stream from the current position, at a rate of [param rate_scale], advancing the stream. Returns a [PackedVector2Array] where each element holds the left and right channel volume levels of each frame. [b]Note:[/b] Can return fewer frames than requested, make sure to use the size of the return value.
func (Instance) SeekTo ¶
func (self Instance) SeekTo()
Seeks the stream at the given [param time], in seconds.
func (Instance) SetSamplePlayback ¶
func (self Instance) SetSamplePlayback(playback_sample AudioSamplePlayback.Instance)
Associates [AudioSamplePlayback] to this [AudioStreamPlayback] for playing back the audio sample of this stream.
type Interface ¶
type Interface interface { //Override this method to customize what happens when the playback starts at the given position, such as by calling [method AudioStreamPlayer.play]. Start(from_pos Float.X) //Override this method to customize what happens when the playback is stopped, such as by calling [method AudioStreamPlayer.stop]. Stop() //Overridable method. Should return [code]true[/code] if this playback is active and playing its audio stream. IsPlaying() bool //Overridable method. Should return how many times this audio stream has looped. Most built-in playbacks always return [code]0[/code]. GetLoopCount() int //Overridable method. Should return the current progress along the audio stream, in seconds. GetPlaybackPosition() Float.X //Override this method to customize what happens when seeking this audio stream at the given [param position], such as by calling [method AudioStreamPlayer.seek]. Seek(position Float.X) //Override this method to customize how the audio stream is mixed. This method is called even if the playback is not active. //[b]Note:[/b] It is not useful to override this method in GDScript or C#. Only GDExtension can take advantage of it. Mix(buffer *AudioFrame, rate_scale Float.X, frames int) int //Overridable method. Called whenever the audio stream is mixed if the playback is active and [method AudioServer.set_enable_tagging_used_audio_streams] has been set to [code]true[/code]. Editor plugins may use this method to "tag" the current position along the audio stream and display it in a preview. TagUsedStreams() //Set the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]). SetParameter(name string, value any) //Return the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]). GetParameter(name string) any }