Inherits: Spatial < Node < Object
Plays 3D sound in 3D space.
Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space.
By default, audio is heard from the camera position. This can be changed by adding a Listener node to the scene and enabling it by calling Listener.make_current on it.
int | area_mask | 1 |
float | attenuation_filter_cutoff_hz | 5000.0 |
float | attenuation_filter_db | -24.0 |
AttenuationModel | attenuation_model | 0 |
bool | autoplay | false |
String | bus | "Master" |
DopplerTracking | doppler_tracking | 0 |
float | emission_angle_degrees | 45.0 |
bool | emission_angle_enabled | false |
float | emission_angle_filter_attenuation_db | -12.0 |
float | max_db | 3.0 |
float | max_distance | 0.0 |
OutOfRangeMode | out_of_range_mode | 0 |
float | pitch_scale | 1.0 |
bool | playing | false |
AudioStream | stream | |
bool | stream_paused | false |
float | unit_db | 0.0 |
float | unit_size | 1.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.
enum AttenuationModel:
enum OutOfRangeMode:
enum DopplerTracking:
Default | 1 |
Setter | set_area_mask(value) |
Getter | get_area_mask() |
Areas in which this sound plays.
Default | 5000.0 |
Setter | set_attenuation_filter_cutoff_hz(value) |
Getter | get_attenuation_filter_cutoff_hz() |
Dampens audio above this frequency, in Hz.
Default | -24.0 |
Setter | set_attenuation_filter_db(value) |
Getter | get_attenuation_filter_db() |
Amount how much the filter affects the loudness, in dB.
Default | 0 |
Setter | set_attenuation_model(value) |
Getter | get_attenuation_model() |
Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
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 | 0 |
Setter | set_doppler_tracking(value) |
Getter | get_doppler_tracking() |
Decides in which step the Doppler effect should be calculated.
Default | 45.0 |
Setter | set_emission_angle(value) |
Getter | get_emission_angle() |
The angle in which the audio reaches cameras undampened.
Default | false |
Setter | set_emission_angle_enabled(value) |
Getter | is_emission_angle_enabled() |
If true
, the audio should be dampened according to the direction of the sound.
Default | -12.0 |
Setter | set_emission_angle_filter_attenuation_db(value) |
Getter | get_emission_angle_filter_attenuation_db() |
Dampens audio if camera is outside of emission_angle_degrees and emission_angle_enabled is set by this factor, in dB.
Default | 3.0 |
Setter | set_max_db(value) |
Getter | get_max_db() |
Sets the absolute maximum of the soundlevel, in dB.
Default | 0.0 |
Setter | set_max_distance(value) |
Getter | get_max_distance() |
Sets the distance from which the out_of_range_mode takes effect. Has no effect if set to 0.
Default | 0 |
Setter | set_out_of_range_mode(value) |
Getter | get_out_of_range_mode() |
Decides if audio should pause when source is outside of max_distance range.
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_unit_db(value) |
Getter | get_unit_db() |
Base sound level unaffected by dampening, in dB.
Default | 1.0 |
Setter | set_unit_size(value) |
Getter | get_unit_size() |
Factor for the attenuation effect.
Returns the position in the AudioStream.
Returns the AudioStreamPlayback object associated with this AudioStreamPlayer3D
.
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_audiostreamplayer3d.html