Struct AudioStreamPlayer2D
Plays audio in 2D.
struct AudioStreamPlayer2D
;
Plays audio that dampens with distance from screen center.
Properties
| Name | Type | Description |
|---|---|---|
areaMask[get, set]
|
long | Areas in which this sound plays. |
attenuation[get, set]
|
double | Dampens audio over distance with this as an exponent. |
autoplay[get, set]
|
bool | If true, audio plays when added to scene tree.
|
bus[get, set]
|
String | Bus on which this audio is playing. |
maxDistance[get, set]
|
double | Maximum distance from which audio is still hearable. |
pitchScale[get, set]
|
double | Changes the pitch and the tempo of the audio. |
playing[get, set]
|
bool | If true, audio is playing.
|
stream[get, set]
|
AudioStream | The AudioStream object to be played.
|
streamPaused[get, set]
|
bool | If true, the playback is paused. You can resume it by setting stream_paused to false.
|
volumeDb[get, set]
|
double | Base volume without dampening. |
Methods
| Name | Description |
|---|---|
_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. |