Struct AudioStreamPlayer2D

Plays audio in 2D.

struct AudioStreamPlayer2D ;

Plays audio that dampens with distance from screen center.

Properties

NameTypeDescription
areaMask[get, set] longAreas in which this sound plays.
attenuation[get, set] doubleDampens audio over distance with this as an exponent.
autoplay[get, set] boolIf true, audio plays when added to scene tree.
bus[get, set] StringBus on which this audio is playing.
maxDistance[get, set] doubleMaximum distance from which audio is still hearable.
pitchScale[get, set] doubleChanges the pitch and the tempo of the audio.
playing[get, set] boolIf true, audio is playing.
stream[get, set] AudioStreamThe AudioStream object to be played.
streamPaused[get, set] boolIf true, the playback is paused. You can resume it by setting stream_paused to false.
volumeDb[get, set] doubleBase volume without dampening.

Methods

NameDescription
_busLayoutChanged
_isActive
_setPlaying
getAreaMask
getAttenuation
getBus
getMaxDistance
getPitchScale
getPlaybackPosition Returns the position in the AudioStream.
getStream
getStreamPaused
getStreamPlayback Returns the AudioStreamPlayback object associated with this AudioStreamPlayer2D.
getVolumeDb
isAutoplayEnabled
isPlaying
play Plays the audio from the given position from_position, in seconds.
seek Sets the position from which audio will be played, in seconds.
setAreaMask
setAttenuation
setAutoplay
setBus
setMaxDistance
setPitchScale
setStream
setStreamPaused
setVolumeDb
stop Stops the audio.