--- OniSplit/Sound/AifExporter.cs 2020/01/22 14:08:57 1114 +++ OniSplit/Sound/AifExporter.cs 2021/05/08 01:44:24 1156 @@ -6,6 +6,8 @@ namespace Oni.Sound internal class AifExporter : SoundExporter { #region Private data + private bool do_pc_demo_test; + private const int fcc_FORM = 0x464f524d; private const int fcc_AIFC = 0x41494643; private const int fcc_COMM = 0x434f4d4d; @@ -19,14 +21,17 @@ namespace Oni.Sound #endregion - public AifExporter(InstanceFileManager fileManager, string outputDirPath) + public AifExporter(InstanceFileManager fileManager, string outputDirPath, bool noDemo = false) : base(fileManager, outputDirPath) { + do_pc_demo_test = !noDemo; } protected override void ExportInstance(InstanceDescriptor descriptor) { - var sound = SoundData.Read(descriptor); + var sound = SoundData.Read(descriptor, do_pc_demo_test); + if (!(sound.IsIMA4)) + throw new NotSupportedException("Transcoding from MS ADPCM (PC) to IMA4 ADPCM (Mac) not supported!"); using (var stream = File.Create(Path.Combine(OutputDirPath, descriptor.FullName + ".aif"))) using (var writer = new BinaryWriter(stream))