Add AudioDataInfo.Length

This commit is contained in:
Wojtek Figat
2023-04-19 15:15:28 +02:00
parent 1e1c296300
commit 552ce3e495
5 changed files with 28 additions and 14 deletions

View File

@@ -0,0 +1,12 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
partial struct AudioDataInfo
{
/// <summary>
/// Gets the length of the audio data (in seconds).
/// </summary>
public float Length => (float)NumSamples / (float)Mathf.Max(1U, SampleRate * NumChannels);
}
}