AudioStreamPlayer2D
Category: Core
Plays audio in 2D.
Properties
get_playback_position ( ) | |
get_stream_playback ( ) | |
void | ( float from_position=0.0 ) |
void | ( float to_position ) |
void | ( ) |
Signals
- finished ( )
Emitted when the audio stops playing.
Plays audio that dampens with distance from screen center.
Tutorials
- area_mask
Setter | set_area_mask(value) |
Getter | get_area_mask() |
Areas in which this sound plays.
- float attenuation
Setter | set_attenuation(value) |
Getter | get_attenuation() |
- autoplay
If , audio plays when added to scene tree. Default value: .
- String bus
Setter | set_bus(value) |
Getter | get_bus() |
Bus on which this audio is playing.
- max_distance
Setter | set_max_distance(value) |
Getter | get_max_distance() |
Maximum distance from which audio is still hearable.
Setter | set_pitch_scale(value) |
Getter | get_pitch_scale() |
Changes the pitch and the tempo of the audio.
- bool playing
If , audio is playing.
- stream
Setter | set_stream(value) |
Getter | get_stream() |
- bool stream_paused
Setter | set_stream_paused(value) |
Getter | get_stream_paused() |
- volume_db
Setter | set_volume_db(value) |
Getter | get_volume_db() |
Base volume without dampening.
Method Descriptions
- float get_playback_position ( )
Returns the position in the .
- AudioStreamPlayback get_stream_playback ( )
- void play ( from_position=0.0 )
Plays the audio from the given position ‘from_position’, in seconds.
Sets the position from which audio will be played, in seconds.
- void stop ( )
Stops the audio.