AudioStreamPlaybackPolyphonic

package
v0.0.0-...-a66c66c Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package AudioStreamPlaybackPolyphonic provides methods for working with AudioStreamPlaybackPolyphonic 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
	AsAudioStreamPlaybackPolyphonic() Instance
}

type Expanded

func (Expanded) PlayStream

func (self Expanded) PlayStream(stream AudioStream.Instance, from_offset Float.X, volume_db Float.X, pitch_scale Float.X, playback_type AudioServer.PlaybackType, bus string) int

Play an [AudioStream] at a given offset, volume, pitch scale, playback type, and bus. Playback starts immediately. The return value is a unique integer ID that is associated to this playback stream and which can be used to control it. This ID becomes invalid when the stream ends (if it does not loop), when the [AudioStreamPlaybackPolyphonic] is stopped, or when [method stop_stream] is called. This function returns [constant INVALID_ID] if the amount of streams currently playing equals [member AudioStreamPolyphonic.polyphony]. If you need a higher amount of maximum polyphony, raise this value.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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 (self *Extension[T]) AsAudioStreamPlayback() AudioStreamPlayback.Instance

func (*Extension[T]) AsAudioStreamPlaybackPolyphonic

func (self *Extension[T]) AsAudioStreamPlaybackPolyphonic() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

Playback instance for [AudioStreamPolyphonic]. After setting the [code]stream[/code] property of [AudioStreamPlayer], [AudioStreamPlayer2D], or [AudioStreamPlayer3D], the playback instance can be obtained by calling [method AudioStreamPlayer.get_stream_playback], [method AudioStreamPlayer2D.get_stream_playback] or [method AudioStreamPlayer3D.get_stream_playback] methods.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsAudioStreamPlayback

func (self Instance) AsAudioStreamPlayback() AudioStreamPlayback.Instance

func (Instance) AsAudioStreamPlaybackPolyphonic

func (self Instance) AsAudioStreamPlaybackPolyphonic() Instance

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsStreamPlaying

func (self Instance) IsStreamPlaying(stream Stream) bool

Returns [code]true[/code] if the stream associated with the given integer ID is still playing. Check [method play_stream] for information on when this ID becomes invalid.

func (Instance) PlayStream

func (self Instance) PlayStream(stream AudioStream.Instance) int

Play an [AudioStream] at a given offset, volume, pitch scale, playback type, and bus. Playback starts immediately. The return value is a unique integer ID that is associated to this playback stream and which can be used to control it. This ID becomes invalid when the stream ends (if it does not loop), when the [AudioStreamPlaybackPolyphonic] is stopped, or when [method stop_stream] is called. This function returns [constant INVALID_ID] if the amount of streams currently playing equals [member AudioStreamPolyphonic.polyphony]. If you need a higher amount of maximum polyphony, raise this value.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetStreamPitchScale

func (self Instance) SetStreamPitchScale(stream Stream, pitch_scale Float.X)

Change the stream pitch scale. The [param stream] argument is an integer ID returned by [method play_stream].

func (Instance) SetStreamVolume

func (self Instance) SetStreamVolume(stream Stream, volume_db Float.X)

Change the stream volume (in db). The [param stream] argument is an integer ID returned by [method play_stream].

func (Instance) StopStream

func (self Instance) StopStream(stream Stream)

Stop a stream. The [param stream] argument is an integer ID returned by [method play_stream], which becomes invalid after calling this function.

func (Instance) Virtual

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

type Stream

type Stream int
const InvalidId Stream = -1 //gd:AudioStreamPlaybackPolyphonic.INVALID_ID

Jump to

Keyboard shortcuts

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