LoadAndDecodeBankFromMemory() 공개 정적인 메소드

public static LoadAndDecodeBankFromMemory ( IntPtr in_BankData, uint in_BankDataSize, bool in_bSaveDecodedBank, string in_DecodedBankName, bool in_bIsLanguageSpecific, uint &out_bankID ) : AKRESULT
in_BankData IntPtr
in_BankDataSize uint
in_bSaveDecodedBank bool
in_DecodedBankName string
in_bIsLanguageSpecific bool
out_bankID uint
리턴 AKRESULT
예제 #1
0
        private static void LoadSoundbankFromStream(Stream stream, string name)
        {
            byte[] array  = StreamToByteArray(stream);
            IntPtr intPtr = Marshal.AllocHGlobal(array.Length);

            try
            {
                Marshal.Copy(array, 0, intPtr, array.Length);
                uint     num;
                AKRESULT akresult = AkSoundEngine.LoadAndDecodeBankFromMemory(intPtr, (uint)array.Length, false, name, false, out num);
                // Console.WriteLine(string.Format("Result of soundbank load: {0}.", akresult));
            }
            finally
            {
                Marshal.FreeHGlobal(intPtr);
            }
        }
        public static void InitAudio(AssetBundle expandSharedAssets1, string assetPath)
        {
            TextAsset SoundBankBinary = expandSharedAssets1.LoadAsset <TextAsset>(assetPath);

            if (SoundBankBinary)
            {
                byte[] array  = SoundBankBinary.bytes;
                IntPtr intPtr = Marshal.AllocHGlobal(array.Length);
                try {
                    Marshal.Copy(array, 0, intPtr, array.Length);
                    uint     num;
                    AKRESULT akresult = AkSoundEngine.LoadAndDecodeBankFromMemory(intPtr, (uint)array.Length, false, SoundBankBinary.name, false, out num);
                    if (ExpandSettings.debugMode)
                    {
                        Console.WriteLine(string.Format("Result of soundbank load: {0}.", akresult));
                    }
                } finally {
                    Marshal.FreeHGlobal(intPtr);
                }
            }
        }