AudioStreamPlayer2D
Plays audio in 2D.
Plays audio that dampens with distance from screen center.
Tutorials
Methods
get_playback_position ( ) | |
get_stream_playback ( ) | |
void | ( float from_position=0.0 ) |
void | ( float to_position ) |
void | ( ) |
- finished ( )
Emitted when the audio stops playing.
Property Descriptions
- int area_mask
Default | 1 |
Setter | set_area_mask(value) |
Getter | get_area_mask() |
Areas in which this sound plays.
- attenuation
Default | 1.0 |
Setter | set_attenuation(value) |
Getter | get_attenuation() |
Dampens audio over distance with this as an exponent.
- bool autoplay
- bus
Default | “Master” |
Setter | set_bus(value) |
Getter | get_bus() |
Bus on which this audio is playing.
- float max_distance
Default | 2000.0 |
Setter | set_max_distance(value) |
Getter | get_max_distance() |
Maximum distance from which audio is still hearable.
- pitch_scale
Default | 1.0 |
Setter | set_pitch_scale(value) |
Getter | get_pitch_scale() |
The pitch and the tempo of the audio, as a multiplier of the audio sample’s sample rate.
If true
, audio is playing.
- AudioStream stream
Setter | set_stream(value) |
Getter | get_stream() |
The object to be played.
- bool stream_paused
Default | false |
Setter | set_stream_paused(value) |
Getter | get_stream_paused() |
- volume_db
Default | 0.0 |
Setter | set_volume_db(value) |
Getter | get_volume_db() |
Base volume without dampening.
- float get_playback_position ( )
Returns the position in the .
- AudioStreamPlayback get_stream_playback ( )
Returns the object associated with this AudioStreamPlayer2D
.
- void play ( float from_position=0.0 )
Plays the audio from the given position , in seconds.
- void seek ( to_position )
Sets the position from which audio will be played, in seconds.