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 1114 by iritscen, Wed Jan 22 14:08:57 2020 UTC vs.
Revision 1156 by geyser, Sat May 8 01:44:24 2021 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 >            if (!(sound.IsIMA4))
34 >                throw new NotSupportedException("Transcoding from MS ADPCM (PC) to IMA4 ADPCM (Mac) not supported!");
35  
36              using (var stream = File.Create(Path.Combine(OutputDirPath, descriptor.FullName + ".aif")))
37              using (var writer = new BinaryWriter(stream))

Diff Legend

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