| 6 |  | { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 7 |  | internal class SoundData | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 8 |  | { | 
 
 
 
 
 
 
 
 | 9 | + | public bool IsIMA4; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 |  | public int SampleRate; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 |  | public int ChannelCount; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 12 |  | public byte[] Data; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 28 |  | sound.ChannelCount = (reader.ReadInt32() >> 1) + 1; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 29 |  | sound.SampleRate = 22050; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 30 |  | reader.Skip(4); | 
 
 
 
 
 
 
 
 | 31 | + | sound.IsIMA4 = true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 32 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 33 |  | else | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 34 |  | { | 
 
 
 
 
 
 
 
 
 
 
 | 35 | < | reader.Skip(6); | 
 
 
 
 
 
 
 
 
 | 35 | > | reader.Skip(6); // ADPCM format identifiers (change to support PCM?) | 
 
 
 
 
 
 
 
 
 
 
 | 36 |  | sound.ChannelCount = reader.ReadInt16(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 37 |  | sound.SampleRate = reader.ReadInt32(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 |  | reader.Skip(44); | 
 
 
 
 
 
 
 
 | 39 | + | sound.IsIMA4 = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 40 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 41 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 42 |  | dataSize = reader.ReadInt32(); |