Enhance audio management and documentation
CI / build-test (push) Successful in 1m10s

Added a MasterVolume property to the AudioManager for unified control over sound effects and music volume. Updated the Play method to incorporate MasterVolume adjustments. Enhanced documentation in CLAUDE.md and architecture.md to reflect changes in audio management and overall engine architecture. Introduced a new test project for audio functionalities in the solution file.
This commit is contained in:
Leonid Pershin
2026-06-12 08:41:39 +03:00
parent 3f3c0200a8
commit ef1111bcb6
8 changed files with 358 additions and 7 deletions
@@ -0,0 +1,42 @@
using MrGameEng.Audio;
using Xunit;
namespace MrGameEng.Audio.Tests;
public class AudioManagerTests
{
[Fact]
public void MasterVolume_Default_IsOne()
{
using var audio = new AudioManager();
Assert.Equal(1f, audio.MasterVolume);
}
[Theory]
[InlineData(-0.5f, 0f)]
[InlineData(0.4f, 0.4f)]
[InlineData(1.7f, 1f)]
public void MasterVolume_Clamps_AndMirrorsToMusic(float input, float expected)
{
using var audio = new AudioManager();
audio.MasterVolume = input;
Assert.Equal(expected, audio.MasterVolume);
Assert.Equal(expected, audio.Music.Volume);
}
[Theory]
[InlineData(-1f, 0f)]
[InlineData(0.25f, 0.25f)]
[InlineData(2f, 1f)]
public void SoundVolume_Clamps(float input, float expected)
{
using var audio = new AudioManager();
audio.SoundVolume = input;
Assert.Equal(expected, audio.SoundVolume);
}
}