Merge pull request #64077 from Calinou/tweak-audiostreamplayer2d3d-default-panning

Decrease default AudioStreamPlayer2D/3D panning strength
This commit is contained in:
Rémi Verschelde 2022-11-15 22:29:23 +01:00
commit d0025a1f02
No known key found for this signature in database
GPG key ID: C3336907360768E1
4 changed files with 12 additions and 10 deletions

View file

@ -1246,10 +1246,10 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF_BASIC("audio/buses/default_bus_layout", "res://default_bus_layout.tres"); 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"); 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); 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,4,0.01"); 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", 1.0f); 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,4,0.01"); 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;
extensions.push_back("gd"); extensions.push_back("gd");

View file

@ -318,11 +318,13 @@
<member name="audio/driver/output_latency.web" type="int" setter="" getter="" default="50"> <member name="audio/driver/output_latency.web" type="int" setter="" getter="" default="50">
Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices. Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices.
</member> </member>
<member name="audio/general/2d_panning_strength" type="float" setter="" getter="" default="1.0"> <member name="audio/general/2d_panning_strength" type="float" setter="" getter="" default="0.5">
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.
</member> </member>
<member name="audio/general/3d_panning_strength" type="float" setter="" getter="" default="1.0"> <member name="audio/general/3d_panning_strength" type="float" setter="" getter="" default="0.5">
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.
</member> </member>
<member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0"> <member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0">
Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing.

View file

@ -82,7 +82,7 @@ private:
float attenuation = 1.0; float attenuation = 1.0;
float panning_strength = 1.0f; float panning_strength = 1.0f;
float cached_global_panning_strength = 1.0f; float cached_global_panning_strength = 0.5f;
protected: protected:
void _validate_property(PropertyInfo &p_property) const; void _validate_property(PropertyInfo &p_property) const;

View file

@ -117,7 +117,7 @@ private:
float _get_attenuation_db(float p_distance) const; float _get_attenuation_db(float p_distance) const;
float panning_strength = 1.0f; float panning_strength = 1.0f;
float cached_global_panning_strength = 1.0f; float cached_global_panning_strength = 0.5f;
protected: protected:
void _validate_property(PropertyInfo &p_property) const; void _validate_property(PropertyInfo &p_property) const;