[GUI] AudioClip improvements

- Increased loading speed of AudioClip preview
- Optimized memory consumption of AudioClip preview
- Fixed incorrect length detection for some sound types
- Added channel count info (audio channels)
This commit is contained in:
VaDiM
2025-01-19 22:23:06 +03:00
parent 1cdb0b762a
commit e3e343320c
7 changed files with 131 additions and 106 deletions

View File

@@ -80,17 +80,18 @@ namespace AssetStudio
lock (binaryReader)
{
binaryReader.BaseStream.Position = Offset;
return binaryReader.ReadBytes((int) size);
return binaryReader.ReadBytes((int)size);
}
}
public void GetData(byte[] buff, int startIndex = 0)
public void GetData(byte[] buff, out int read, int startIndex = 0)
{
read = -1;
var binaryReader = GetReader();
lock (binaryReader)
{
binaryReader.BaseStream.Position = Offset;
binaryReader.Read(buff, startIndex, (int) size);
read = binaryReader.Read(buff, startIndex, (int)size);
}
}