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

Comparing OniSplit/Sound/AifExporter.cs (file contents):
Revision 1130 by geyser, Thu May 28 21:28:44 2020 UTC vs.
Revision 1131 by geyser, Sat May 30 12:08:12 2020 UTC

# Line 6 | Line 6 | namespace Oni.Sound
6      internal class AifExporter : SoundExporter
7      {
8          #region Private data
9 +        private bool do_pc_demo_test;
10 +
11          private const int fcc_FORM = 0x464f524d;
12          private const int fcc_AIFC = 0x41494643;
13          private const int fcc_COMM = 0x434f4d4d;
# Line 19 | Line 21 | namespace Oni.Sound
21  
22          #endregion
23  
24 <        public AifExporter(InstanceFileManager fileManager, string outputDirPath)
24 >        public AifExporter(InstanceFileManager fileManager, string outputDirPath, bool noDemo = false)
25              : base(fileManager, outputDirPath)
26          {
27 +            do_pc_demo_test = !noDemo;
28          }
29  
30          protected override void ExportInstance(InstanceDescriptor descriptor)
31          {
32 <            var sound = SoundData.Read(descriptor);
32 >            var sound = SoundData.Read(descriptor, do_pc_demo_test);
33  
34              using (var stream = File.Create(Path.Combine(OutputDirPath, descriptor.FullName + ".aif")))
35              using (var writer = new BinaryWriter(stream))
36              {
37                  if (!(sound.IsIMA4))
38                  {
39 <                    throw new NotSupportedException("Transcoding from PC ADPCM to Mac/demo ADPCM not supported!");
39 >                    throw new NotSupportedException("Transcoding from MS ADPCM (PC) to IMA4 ADPCM (Mac) not supported!");
40                  }
41                  writer.Write(Utils.ByteSwap(fcc_FORM));
42                  writer.Write(Utils.ByteSwap(50 + sound.Data.Length));

Diff Legend

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