From 160d10dc7b09437d77d46517bc69fd8f0ff6eb73 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 7 Aug 2022 22:45:05 +0200 Subject: Decrease default AudioStreamPlayer2D/3D panning strength The default panning strength is now more in line with how other engines play positional sound. --- core/config/project_settings.cpp | 8 ++++---- doc/classes/ProjectSettings.xml | 10 ++++++---- scene/2d/audio_stream_player_2d.h | 2 +- scene/3d/audio_stream_player_3d.h | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 5c4bcc687a..f1ccabf8d1 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1203,10 +1203,10 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF_BASIC("audio/buses/default_bus_layout", "res://default_bus_layout.tres"); custom_prop_info["audio/buses/default_bus_layout"] = PropertyInfo(Variant::STRING, "audio/buses/default_bus_layout", PROPERTY_HINT_FILE, "*.tres"); - GLOBAL_DEF_RST("audio/general/2d_panning_strength", 1.0f); - custom_prop_info["audio/general/2d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/2d_panning_strength", PROPERTY_HINT_RANGE, "0,4,0.01"); - GLOBAL_DEF_RST("audio/general/3d_panning_strength", 1.0f); - custom_prop_info["audio/general/3d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/3d_panning_strength", PROPERTY_HINT_RANGE, "0,4,0.01"); + GLOBAL_DEF_RST("audio/general/2d_panning_strength", 0.5f); + custom_prop_info["audio/general/2d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/2d_panning_strength", PROPERTY_HINT_RANGE, "0,2,0.01"); + GLOBAL_DEF_RST("audio/general/3d_panning_strength", 0.5f); + custom_prop_info["audio/general/3d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/3d_panning_strength", PROPERTY_HINT_RANGE, "0,2,0.01"); PackedStringArray extensions = PackedStringArray(); extensions.push_back("gd"); diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index a6c18bbe2f..1c1c1eb84f 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -310,11 +310,13 @@ Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices. - - The base strength of the panning effect for all AudioStreamPlayer2D nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer2D.panning_strength]. + + The base strength of the panning effect for all [AudioStreamPlayer2D] nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer2D.panning_strength]. A value of [code]0.0[/code] disables stereo panning entirely, leaving only volume attenuation in place. A value of [code]1.0[/code] completely mutes one of the channels if the sound is located exactly to the left (or right) of the listener. + The default value of [code]0.5[/code] is tuned for headphones. When using speakers, you may find lower values to sound better as speakers have a lower stereo separation compared to headphones. - - The base strength of the panning effect for all AudioStreamPlayer3D nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer3D.panning_strength]. + + The base strength of the panning effect for all [AudioStreamPlayer3D] nodes. The panning strength can be further scaled on each Node using [member AudioStreamPlayer3D.panning_strength]. A value of [code]0.0[/code] disables stereo panning entirely, leaving only volume attenuation in place. A value of [code]1.0[/code] completely mutes one of the channels if the sound is located exactly to the left (or right) of the listener. + The default value of [code]0.5[/code] is tuned for headphones. When using speakers, you may find lower values to sound better as speakers have a lower stereo separation compared to headphones. Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. diff --git a/scene/2d/audio_stream_player_2d.h b/scene/2d/audio_stream_player_2d.h index d1c4dc4fdf..c771bb6d5f 100644 --- a/scene/2d/audio_stream_player_2d.h +++ b/scene/2d/audio_stream_player_2d.h @@ -82,7 +82,7 @@ private: float attenuation = 1.0; float panning_strength = 1.0f; - float cached_global_panning_strength = 1.0f; + float cached_global_panning_strength = 0.5f; protected: void _validate_property(PropertyInfo &property) const override; diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h index 647b18a4a7..144b647127 100644 --- a/scene/3d/audio_stream_player_3d.h +++ b/scene/3d/audio_stream_player_3d.h @@ -117,7 +117,7 @@ private: float _get_attenuation_db(float p_distance) const; float panning_strength = 1.0f; - float cached_global_panning_strength = 1.0f; + float cached_global_panning_strength = 0.5f; protected: void _validate_property(PropertyInfo &property) const override; -- cgit v1.2.3