Attention: Here be dragons
This is the
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Plays back audio non-positionally.
Plays an audio stream non-positionally.
To play audio positionally, use AudioStreamPlayer2D or AudioStreamPlayer3D instead of AudioStreamPlayer.
stop ( )
finished ( )
Emitted when the audio stops playing.
MixTarget MIX_TARGET_STEREO =
The audio will be played only on the first channel.
MixTarget MIX_TARGET_SURROUND =
The audio will be played on all surround channels.
MixTarget MIX_TARGET_CENTER =
The audio will be played on the second channel, which is usually the center.
bool autoplay =
true, audio plays when added to scene tree.
StringName bus =
void set_bus ( StringName value )
StringName get_bus ( )
Bus on which this audio is playing.
Note: When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to
int max_polyphony =
The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
MixTarget mix_target =
If the audio configuration has more than two speakers, this sets the target channels. See MixTarget constants.
float pitch_scale =
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
bool playing =
bool is_playing ( )
true, audio is playing.
void set_stream ( AudioStream value )
AudioStream get_stream ( )
The AudioStream object to be played.
bool stream_paused =
true, the playback is paused. You can resume it by setting
float volume_db =
Volume of sound, in dB.
float get_playback_position ( )
Returns the position in the AudioStream in seconds.
AudioStreamPlayback get_stream_playback ( )
Returns the AudioStreamPlayback object associated with this AudioStreamPlayer.
bool has_stream_playback ( )
Returns whether the AudioStreamPlayer can return the AudioStreamPlayback object or not.
void play ( float from_position=0.0 )
Plays the audio from the given
from_position, in seconds.
void seek ( float to_position )
Sets the position from which audio will be played, in seconds.
void stop ( )
Stops the audio.