Support 8 bit .aud files.
This commit is contained in:
committed by
Paul Chote
parent
d38fe542a2
commit
9a9f58d744
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
return (float)samples / sampleRate;
|
||||
}
|
||||
|
||||
public static bool LoadSound(Stream s, out Func<Stream> result, out int sampleRate)
|
||||
public static bool LoadSound(Stream s, out Func<Stream> result, out int sampleRate, out int sampleBits)
|
||||
{
|
||||
result = null;
|
||||
var startPosition = s.Position;
|
||||
@@ -58,10 +58,8 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
sampleRate = s.ReadUInt16();
|
||||
var dataSize = s.ReadInt32();
|
||||
var outputSize = s.ReadInt32();
|
||||
|
||||
var readFlag = s.ReadByte();
|
||||
if (!Enum.IsDefined(typeof(SoundFlags), readFlag))
|
||||
return false;
|
||||
sampleBits = (readFlag & (int)SoundFlags._16Bit) == 0 ? 8 : 16;
|
||||
|
||||
var readFormat = s.ReadByte();
|
||||
if (!Enum.IsDefined(typeof(SoundFormat), readFormat))
|
||||
|
||||
Reference in New Issue
Block a user