Documentation
¶
Overview ¶
Package AudioStreamPlayer provides methods for working with AudioStreamPlayer object instances.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsAudioStreamPlayer() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Autoplay() bool
- func (self Instance) Bus() string
- func (self Instance) GetPlaybackPosition() Float.X
- func (self Instance) GetStreamPlayback() AudioStreamPlayback.Instance
- func (self Instance) HasStreamPlayback() bool
- func (self Instance) ID() ID
- func (self Instance) MaxPolyphony() int
- func (self Instance) MixTarget() MixTarget
- func (self Instance) OnFinished(cb func(), flags ...Signal.Flags)
- func (self Instance) PitchScale() Float.X
- func (self Instance) Play()
- func (self Instance) PlaybackType() AudioServer.PlaybackType
- func (self Instance) Playing() bool
- func (self Instance) SeekTo(to_position Float.X)
- func (self Instance) SetAutoplay(value bool)
- func (self Instance) SetBus(value string)
- func (self Instance) SetMaxPolyphony(value int)
- func (self Instance) SetMixTarget(value MixTarget)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPitchScale(value Float.X)
- func (self Instance) SetPlaybackType(value AudioServer.PlaybackType)
- func (self Instance) SetPlaying(value bool)
- func (self Instance) SetStream(value AudioStream.Instance)
- func (self Instance) SetStreamPaused(value bool)
- func (self Instance) SetVolumeDb(value Float.X)
- func (self Instance) SetVolumeLinear(value Float.X)
- func (self Instance) Stop()
- func (self Instance) Stream() AudioStream.Instance
- func (self Instance) StreamPaused() bool
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) VolumeDb() Float.X
- func (self Instance) VolumeLinear() Float.X
- type MixTarget
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 Expanded ¶
type Expanded [1]gdclass.AudioStreamPlayer
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]) AsAudioStreamPlayer ¶
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 Instance ¶
type Instance [1]gdclass.AudioStreamPlayer
The [AudioStreamPlayer] node plays an audio stream non-positionally. It is ideal for user interfaces, menus, or background music. To use this node, [member stream] needs to be set to a valid [AudioStream] resource. Playing more than one sound at the same time is also supported, see [member max_polyphony]. If you need to play audio at a specific position, use [AudioStreamPlayer2D] or [AudioStreamPlayer3D] instead.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsAudioStreamPlayer ¶
func (Instance) GetPlaybackPosition ¶
Returns the position in the [AudioStream] of the latest sound, in seconds. Returns [code]0.0[/code] if no sounds are playing. [b]Note:[/b] The position is not always accurate, as the [AudioServer] does not mix audio every processed frame. To get more accurate results, add [method AudioServer.get_time_since_last_mix] to the returned position. [b]Note:[/b] This method always returns [code]0.0[/code] if the [member stream] is an [AudioStreamInteractive], since it can have multiple clips playing at once.
func (Instance) GetStreamPlayback ¶
func (self Instance) GetStreamPlayback() AudioStreamPlayback.Instance
Returns the latest [AudioStreamPlayback] of this node, usually the most recently created by [method play]. If no sounds are playing, this method fails and returns an empty playback.
func (Instance) HasStreamPlayback ¶
Returns [code]true[/code] if any sound is active, even if [member stream_paused] is set to [code]true[/code]. See also [member playing] and [method get_stream_playback].
func (Instance) MaxPolyphony ¶
func (Instance) OnFinished ¶
func (Instance) PitchScale ¶
func (Instance) Play ¶
func (self Instance) Play()
Plays a sound from the beginning, or the given [param from_position] in seconds.
func (Instance) PlaybackType ¶
func (self Instance) PlaybackType() AudioServer.PlaybackType
func (Instance) SeekTo ¶
Restarts all sounds to be played from the given [param to_position], in seconds. Does nothing if no sounds are playing.
func (Instance) SetAutoplay ¶
func (Instance) SetMaxPolyphony ¶
func (Instance) SetMixTarget ¶
func (Instance) SetPitchScale ¶
func (Instance) SetPlaybackType ¶
func (self Instance) SetPlaybackType(value AudioServer.PlaybackType)
func (Instance) SetPlaying ¶
func (Instance) SetStream ¶
func (self Instance) SetStream(value AudioStream.Instance)
func (Instance) SetStreamPaused ¶
func (Instance) SetVolumeDb ¶
func (Instance) SetVolumeLinear ¶
func (Instance) Stream ¶
func (self Instance) Stream() AudioStream.Instance
func (Instance) StreamPaused ¶
func (*Instance) UnsafePointer ¶
func (Instance) VolumeLinear ¶
type MixTarget ¶
type MixTarget int //gd:AudioStreamPlayer.MixTarget
const ( /*The audio will be played only on the first channel. This is the default.*/ MixTargetStereo MixTarget = 0 /*The audio will be played on all surround channels.*/ MixTargetSurround MixTarget = 1 /*The audio will be played on the second channel, which is usually the center.*/ MixTargetCenter MixTarget = 2 )