Example #1
0
        public AssetBuffer ProcessAudioFileInstance(InstanceDeclaration declaration)
        {
            XmlNamespaceManager namespaceManager = declaration.Document.NamespaceManager;
            XPathNavigator      navigator        = declaration.Node.CreateNavigator();
            // TODO: initialize tracker on new audiofileruntimeptr
            AudioFile audioFile = AudioFile.MarshalFromNode(declaration.Node);

            if (_platform != TargetPlatform.Win32 || audioFile.PCCompression != PCAudioCompressionSetting.EALAYER3)
            {
                foreach (PluginDescriptor plugin in Settings.Current.Plugins)
                {
                    if (plugin.Plugin is AudioCompiler.Plugin acPlugin)
                    {
                        return(acPlugin.ProcessAudioFileInstance(declaration));
                    }
                }
                throw new InvalidOperationException("Critical: Original EALA BinaryAssetBuilder.AudioCompiler.dll plugin not found.");
            }
            if (!EncodeEALayer3(declaration, audioFile, out AssetBuffer result))
            {
                throw new BinaryAssetBuilderException(ErrorCode.InternalError, "EALayer3 audio compiler was unable to compile AudioFile:{0}.", audioFile.id);
            }
            return(result);
        }