Documentation
¶
Overview ¶
Package AudioStream provides methods for working with AudioStream object instances.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AsAudioStream() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) CanBeSampled() bool
- func (self Instance) GenerateSample() AudioSample.Instance
- func (self Instance) GetLength() Float.X
- func (self Instance) ID() ID
- func (self Instance) InstantiatePlayback() AudioStreamPlayback.Instance
- func (self Instance) IsMetaStream() bool
- func (self Instance) IsMonophonic() bool
- func (self Instance) OnParameterListChanged(cb func(), flags ...Signal.Flags)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- 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 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]) AsAudioStream ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
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.AudioStream
Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via [AudioStreamWAV]) and Ogg (via [AudioStreamOggVorbis]) file formats.
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) AsAudioStream ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) CanBeSampled ¶
Returns if the current [AudioStream] can be used as a sample. Only static streams can be sampled.
func (Instance) GenerateSample ¶
func (self Instance) GenerateSample() AudioSample.Instance
Generates an [AudioSample] based on the current stream.
func (Instance) InstantiatePlayback ¶
func (self Instance) InstantiatePlayback() AudioStreamPlayback.Instance
Returns a newly created [AudioStreamPlayback] intended to play this audio stream. Useful for when you want to extend [method _instantiate_playback] but call [method instantiate_playback] from an internally held AudioStream subresource. An example of this can be found in the source code for [code]AudioStreamRandomPitch::instantiate_playback[/code].
func (Instance) IsMetaStream ¶
Returns [code]true[/code] if the stream is a collection of other streams, [code]false[/code] otherwise.
func (Instance) IsMonophonic ¶
Returns [code]true[/code] if this audio stream only supports one channel ([i]monophony[/i]), or [code]false[/code] if the audio stream supports two or more channels ([i]polyphony[/i]).
func (Instance) OnParameterListChanged ¶
type Interface ¶
type Interface interface { //Override this method to customize the returned value of [method instantiate_playback]. Should return a new [AudioStreamPlayback] created when the stream is played (such as by an [AudioStreamPlayer]). InstantiatePlayback() AudioStreamPlayback.Instance //Override this method to customize the name assigned to this audio stream. Unused by the engine. GetStreamName() string //Override this method to customize the returned value of [method get_length]. Should return the length of this audio stream, in seconds. GetLength() Float.X //Override this method to customize the returned value of [method is_monophonic]. Should return [code]true[/code] if this audio stream only supports one channel. IsMonophonic() bool //Overridable method. Should return the tempo of this audio stream, in beats per minute (BPM). Used by the engine to determine the position of every beat. //Ideally, the returned value should be based off the stream's sample rate ([member AudioStreamWAV.mix_rate], for example). GetBpm() Float.X //Overridable method. Should return the total number of beats of this audio stream. Used by the engine to determine the position of every beat. //Ideally, the returned value should be based off the stream's sample rate ([member AudioStreamWAV.mix_rate], for example). GetBeatCount() int //Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see [method Object.get_property_list]). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field. GetParameterList() []map[any]any //Override this method to return [code]true[/code] if this stream has a loop. HasLoop() bool //Override this method to return the bar beats of this stream. GetBarBeats() int }