AudioStreamPlayer

package
v0.0.0-...-ae8aae0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package AudioStreamPlayer provides methods for working with AudioStreamPlayer object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsAudioStreamPlayer() Instance
}

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 New

func New() Instance

func (Instance) AsAudioStreamPlayer

func (self Instance) AsAudioStreamPlayer() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) Autoplay

func (self Instance) Autoplay() bool

func (Instance) Bus

func (self Instance) Bus() string

func (Instance) GetPlaybackPosition

func (self Instance) GetPlaybackPosition() Float.X

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.

func (Instance) GetStreamPlayback

func (self Instance) GetStreamPlayback() [1]gdclass.AudioStreamPlayback

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

func (self Instance) HasStreamPlayback() bool

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 (self Instance) MaxPolyphony() int

func (Instance) MixTarget

func (self Instance) MixTarget() gdclass.AudioStreamPlayerMixTarget

func (Instance) OnFinished

func (self Instance) OnFinished(cb func())

func (Instance) PitchScale

func (self Instance) PitchScale() Float.X

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() gdclass.AudioServerPlaybackType

func (Instance) Playing

func (self Instance) Playing() bool

func (Instance) SeekTo

func (self Instance) SeekTo(to_position Float.X)

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 (self Instance) SetAutoplay(value bool)

func (Instance) SetBus

func (self Instance) SetBus(value string)

func (Instance) SetMaxPolyphony

func (self Instance) SetMaxPolyphony(value int)

func (Instance) SetMixTarget

func (self Instance) SetMixTarget(value gdclass.AudioStreamPlayerMixTarget)

func (Instance) SetPitchScale

func (self Instance) SetPitchScale(value Float.X)

func (Instance) SetPlaybackType

func (self Instance) SetPlaybackType(value gdclass.AudioServerPlaybackType)

func (Instance) SetStream

func (self Instance) SetStream(value [1]gdclass.AudioStream)

func (Instance) SetStreamPaused

func (self Instance) SetStreamPaused(value bool)

func (Instance) SetVolumeDb

func (self Instance) SetVolumeDb(value Float.X)

func (Instance) Stop

func (self Instance) Stop()

Stops all sounds from this node.

func (Instance) Stream

func (self Instance) Stream() [1]gdclass.AudioStream

func (Instance) StreamPaused

func (self Instance) StreamPaused() bool

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) VolumeDb

func (self Instance) VolumeDb() Float.X

type MixTarget

type MixTarget = gdclass.AudioStreamPlayerMixTarget //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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL