Esempio n. 1
0
        public void ExtractType(ICLIFlags toolFlags)
        {
            string basePath;

            if (toolFlags is ExtractFlags flags)
            {
                basePath = flags.OutputPath + "\\Music";
            }
            else
            {
                throw new Exception("no output path");
            }

            foreach (ulong @ulong in TrackedFiles[0x2C])
            {
                STUSound music   = GetInstance <STUSound>(@ulong);
                var      s_class = music.m_C32C2195.m_wwiseBankID;
                if (music_types.ContainsKey(s_class))
                {
                    FindLogic.Combo.ComboInfo info = new FindLogic.Combo.ComboInfo();
                    var context = new Combo.SaveContext(info);
                    FindLogic.Combo.Find(info, @ulong);
                    SaveLogic.Combo.SaveAllSoundFiles(flags, Path.Combine(basePath, music_types[s_class]), context);
                    context.Wait();
                }
            }
        }
Esempio n. 2
0
        public void SaveSounds(ICLIFlags toolFlags)
        {
            string basePath;

            if (toolFlags is ExtractFlags flags)
            {
                basePath = flags.OutputPath;
            }
            else
            {
                throw new Exception("no output path");
            }


            foreach (ulong key in TrackedFiles[0x2C])
            {
                if (GUID.Index(key) != 0x3BAF)
                {
                    continue;                             // used in Reaper's Eternal Rest intro. (eerie background + door break)
                }
                STUSound sound = GetInstance <STUSound>(key);
                Dictionary <uint, Common.STUGUID> soundIDs = new Dictionary <uint, Common.STUGUID>();
                if (sound.Inner == null)
                {
                    continue;
                }
                STUSoundbankDataVersion inner = sound.Inner;
                for (int i = 0; i < inner.IDs.Length; i++)
                {
                    soundIDs[inner.IDs[i]] = inner.Sounds[i];
                }

                using (Stream bnkStream = OpenFile(inner.Soundbank)) {
                    Sound.WwiseBank bank = new Sound.WwiseBank(bnkStream);
                }
            }
        }