Fix error in Editor when Audio Clip duration is very small

#2286
This commit is contained in:
Wojtek Figat
2024-03-04 21:20:25 +01:00
parent 21edb43bb1
commit 0604a0393d

View File

@@ -184,6 +184,7 @@ namespace FlaxEditor.Viewport.Previews
break;
default: throw new ArgumentOutOfRangeException();
}
samplesPerIndex = Math.Max(samplesPerIndex, info.NumChannels);
const uint maxSamplesPerIndex = 64;
uint samplesPerIndexDiff = Math.Max(1, samplesPerIndex / Math.Min(samplesPerIndex, maxSamplesPerIndex));