forked from Unity-Technologies/UnityDataTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioClip.cs
More file actions
30 lines (26 loc) · 1021 Bytes
/
Copy pathAudioClip.cs
File metadata and controls
30 lines (26 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using UnityDataTools.FileSystem.TypeTreeReaders;
namespace UnityDataTools.Analyzer.SerializedObjects;
public class AudioClip
{
public string Name { get; init; }
public int StreamDataSize { get; init; }
public int BitsPerSample { get; init; }
public int Frequency { get; init; }
public int Channels { get; init; }
public int LoadType { get; init; }
public int Format { get; init; }
private AudioClip() {}
public static AudioClip Read(RandomAccessReader reader)
{
return new AudioClip()
{
Name = reader["m_Name"].GetValue<string>(),
Channels = reader["m_Channels"].GetValue<int>(),
Format = reader["m_CompressionFormat"].GetValue<int>(),
Frequency = reader["m_Frequency"].GetValue<int>(),
LoadType = reader["m_LoadType"].GetValue<int>(),
BitsPerSample = reader["m_BitsPerSample"].GetValue<int>(),
StreamDataSize = reader["m_Resource"]["m_Size"].GetValue<int>()
};
}
}