Improved UI

This commit is contained in:
max
2025-12-18 03:00:13 +01:00
parent e0af3aefe1
commit 6249499be2
5 changed files with 272 additions and 142 deletions

View File

@@ -9,7 +9,7 @@ namespace Car_simulation
// Audio properties - smaller buffer for less latency
private const uint SAMPLE_RATE = 44100;
private const ushort CHANNEL_COUNT = 2; // Stereo
private const float BUFFER_DURATION = 0.01f; // 10ms instead of 50ms!
private const float BUFFER_DURATION = 0.05f; // 10ms instead of 50ms!
// Engine sound properties - NO SMOOTHING for instant response
private volatile float _currentRPM = 800f; // volatile for thread safety
@@ -44,8 +44,6 @@ namespace Car_simulation
{
_harmonicPhases[i] = (float)(_random.NextDouble() * 2 * Math.PI);
}
Console.WriteLine($"EngineSound initialized: {BUFFER_DURATION * 1000:F0}ms buffer, {CylinderCount} cylinders");
}
// CALL THIS FROM YOUR PHYSICS THREAD - INSTANT UPDATE