ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/OniSplit/Sound/WavImporter.cs
(Generate patch)

Comparing OniSplit/Sound/WavImporter.cs (file contents):
Revision 1154 by geyser, Mon May 3 15:22:15 2021 UTC vs.
Revision 1156 by geyser, Sat May 8 01:44:24 2021 UTC

# Line 45 | Line 45 | namespace Oni.Sound
45  
46          private void WriteSNDD(string name, WavFile wav)
47          {
48 <            float duration = wav.SoundData.Length * 8.0f / wav.BitsPerSample;
49 <            duration /= wav.SampleRate;
50 <            duration /= wav.ChannelCount;
51 <            duration *= 60.0f;
48 >            float duration = wav.SampleCount * 60.0f / wav.SampleRate;
49  
50              var sndd = CreateInstance(TemplateTag.SNDD, name);
51              if (convertToDemo)
# Line 73 | Line 70 | namespace Oni.Sound
70                      writer.Write((int)duration);
71                      writer.Write(wav.SoundData.Length);
72                      writer.Write(WriteRawPart(wav.SoundData));
73 +                    writer.Skip(8);
74                  }
75              }
76              else
# Line 96 | Line 94 | namespace Oni.Sound
94                      writer.Write((short)duration);
95                      writer.Write(wav.SoundData.Length);
96                      writer.Write(WriteRawPart(wav.SoundData));
97 +                    writer.Skip(24);
98                  }
99              }
100          }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)