Fix AudioClip loading error when buffer start times diff has rounding error

This commit is contained in:
Wojtek Figat
2023-10-06 11:40:39 +02:00
parent 9870d162e4
commit 176123eb1f

View File

@@ -348,7 +348,7 @@ Asset::LoadResult AudioClip::load()
#if !BUILD_RELEASE #if !BUILD_RELEASE
// Validate buffer start times // Validate buffer start times
if (Math::NotNearEqual(_buffersStartTimes[_totalChunks], GetLength())) if (!Math::NearEqual(_buffersStartTimes[_totalChunks], GetLength(), 1.0f / 60.0f))
{ {
LOG(Warning, "Invalid audio buffers data size. Expected length: {0}s", GetLength()); LOG(Warning, "Invalid audio buffers data size. Expected length: {0}s", GetLength());
for (int32 i = 0; i < _totalChunks + 1; i++) for (int32 i = 0; i < _totalChunks + 1; i++)