AudioStreamPlayer2D

Plays positional sound in 2D space.

Plays audio that dampens with distance from screen center. See also AudioStreamPlayer to play a sound non-positionally. Note: Hiding an AudioStreamPlayer2D node does not disable its audio output. To temporarily disable an AudioStreamPlayer2D's audio output, set volumeDb to a very low value like -100 (which isn't audible to human hearing).

@GodotBaseClass
struct AudioStreamPlayer2D {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_busLayoutChanged
void _busLayoutChanged()
_isActive
bool _isActive()
_setPlaying
void _setPlaying(bool enable)
getAreaMask
long getAreaMask()
getAttenuation
double getAttenuation()
getBus
String getBus()
getMaxDistance
double getMaxDistance()
getPitchScale
double getPitchScale()
getPlaybackPosition
double getPlaybackPosition()

Returns the position in the AudioStream.

getStream
Ref!AudioStream getStream()
getStreamPaused
bool getStreamPaused()
getStreamPlayback
Ref!AudioStreamPlayback getStreamPlayback()

Returns the AudioStreamPlayback object associated with this AudioStreamPlayer2D.

getVolumeDb
double getVolumeDb()
isAutoplayEnabled
bool isAutoplayEnabled()
isPlaying
bool isPlaying()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(AudioStreamPlayer2D other)
opEquals
bool opEquals(typeof(null) n)
play
void play(double from_position)

Plays the audio from the given position from_position, in seconds.

seek
void seek(double to_position)

Sets the position from which audio will be played, in seconds.

setAreaMask
void setAreaMask(long mask)
setAttenuation
void setAttenuation(double curve)
setAutoplay
void setAutoplay(bool enable)
setBus
void setBus(String bus)
setMaxDistance
void setMaxDistance(double pixels)
setPitchScale
void setPitchScale(double pitch_scale)
setStream
void setStream(AudioStream stream)
setStreamPaused
void setStreamPaused(bool pause)
setVolumeDb
void setVolumeDb(double volume_db)
stop
void stop()

Stops the audio.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

areaMask
long areaMask [@property getter]
long areaMask [@property setter]

Areas in which this sound plays.

attenuation
double attenuation [@property getter]
double attenuation [@property setter]

Dampens audio over distance with this as an exponent.

autoplay
bool autoplay [@property getter]
bool autoplay [@property setter]

If true, audio plays when added to scene tree.

bus
String bus [@property getter]
String bus [@property setter]

Bus on which this audio is playing.

maxDistance
double maxDistance [@property getter]
double maxDistance [@property setter]

Maximum distance from which audio is still hearable.

pitchScale
double pitchScale [@property getter]
double pitchScale [@property setter]

The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.

playing
bool playing [@property getter]
bool playing [@property setter]

If true, audio is playing.

stream
AudioStream stream [@property getter]
AudioStream stream [@property setter]

The AudioStream object to be played.

streamPaused
bool streamPaused [@property getter]
bool streamPaused [@property setter]

If true, the playback is paused. You can resume it by setting stream_paused to false.

volumeDb
double volumeDb [@property getter]
double volumeDb [@property setter]

Base volume without dampening.

Static functions

_new
AudioStreamPlayer2D _new()

Construct a new instance of AudioStreamPlayer2D. Note: use memnew!AudioStreamPlayer2D instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta