Release 1.9.7.0 - Summer Update 2025
This commit is contained in:
@@ -29,6 +29,15 @@ namespace Barotrauma
|
||||
Volume = element.GetAttributeFloat("volume", 1.0f);
|
||||
IgnoreMuffling = element.GetAttributeBool("dontmuffle", false);
|
||||
MuteBackgroundMusic = element.GetAttributeBool("MuteBackgroundMusic", false);
|
||||
|
||||
if (!Stream && Sound.DurationSeconds > 60.0f)
|
||||
{
|
||||
DebugConsole.AddWarning(
|
||||
$"Potential issue in content package: a large audio clip \"{System.IO.Path.GetFileName(Filename)}\" is set to be loaded into memory instead of streaming it from the disk. "+
|
||||
"This can lead to excessive memory usage. Large clips should generally be streamed, while small and frequently played sounds should be loaded to memory to avoid the IO overhead of streaming. "+
|
||||
"Consider adding stream=\"true\" to the sound's XML element.",
|
||||
contentPackage: element.ContentPackage);
|
||||
}
|
||||
|
||||
FrequencyMultiplierRange = new Vector2(1.0f);
|
||||
string freqMultAttr = element.GetAttributeString("frequencymultiplier", element.GetAttributeString("frequency", "1.0"));
|
||||
@@ -61,10 +70,11 @@ namespace Barotrauma
|
||||
|
||||
private static readonly List<RoundSound> roundSounds = new List<RoundSound>();
|
||||
private static readonly Dictionary<string, RoundSound> roundSoundByPath = new Dictionary<string, RoundSound>();
|
||||
public static RoundSound? Load(ContentXElement element, bool stream = false)
|
||||
public static RoundSound? Load(ContentXElement element)
|
||||
{
|
||||
if (GameMain.SoundManager?.Disabled ?? true) { return null; }
|
||||
|
||||
bool stream = element.GetAttributeBool(nameof(Stream), false);
|
||||
var filename = element.GetAttributeContentPath("file") ?? element.GetAttributeContentPath("sound");
|
||||
if (filename is null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user