Inherits: Node2D < CanvasItem < Node < Object
Plays audio in 2D.
Plays audio that dampens with distance from screen center.
int | area_mask | 1 |
float | attenuation | 1.0 |
bool | autoplay | false |
String | bus | "Master" |
float | max_distance | 2000.0 |
float | pitch_scale | 1.0 |
bool | playing | false |
AudioStream | stream | |
bool | stream_paused | false |
float | volume_db | 0.0 |
float | get_playback_position ( ) |
AudioStreamPlayback | get_stream_playback ( ) |
void | play ( float from_position=0.0 ) |
void | seek ( float to_position ) |
void | stop ( ) |
Emitted when the audio stops playing.
Default | 1 |
Setter | set_area_mask(value) |
Getter | get_area_mask() |
Areas in which this sound plays.
Default | 1.0 |
Setter | set_attenuation(value) |
Getter | get_attenuation() |
Dampens audio over distance with this as an exponent.
Default | false |
Setter | set_autoplay(value) |
Getter | is_autoplay_enabled() |
If true
, audio plays when added to scene tree.
Default | "Master" |
Setter | set_bus(value) |
Getter | get_bus() |
Bus on which this audio is playing.
Default | 2000.0 |
Setter | set_max_distance(value) |
Getter | get_max_distance() |
Maximum distance from which audio is still hearable.
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.
Default | false |
Getter | is_playing() |
If true
, audio is playing.
Setter | set_stream(value) |
Getter | get_stream() |
The AudioStream object to be played.
Default | false |
Setter | set_stream_paused(value) |
Getter | get_stream_paused() |
If true
, the playback is paused. You can resume it by setting stream_paused
to false
.
Default | 0.0 |
Setter | set_volume_db(value) |
Getter | get_volume_db() |
Base volume without dampening.
Returns the position in the AudioStream.
Returns the AudioStreamPlayback object associated with this AudioStreamPlayer2D
.
Plays the audio from the given position from_position
, in seconds.
Sets the position from which audio will be played, in seconds.
Stops the audio.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_audiostreamplayer2d.html