/// <summary> /// Constructs a new instance of <see cref="FModMultiSounds"/>. Used to register FMOD events with multiple sounds in one event. /// </summary> /// <param name="soundPaths">The sound paths to register for this object. Paths must be relative to the base game folder.</param> /// <param name="mode">The mode to set the clips to. Cannot be <c>MODE.LOOP_NORMAL</c> or <c>MODE.LOOP_BIDI</c>.</param> /// <param name="busPath"><see cref="Bus"/> path to play these sounds under.</param> /// <param name="randomizeSounds">Makes the sounds play in a randomized order. when <c>false</c>, sounds will play subsequently.</param> public FModMultiSounds(string[] soundPaths, MODE mode, string busPath, bool randomizeSounds = false) { mode &= ~MODE.LOOP_NORMAL & ~MODE.LOOP_BIDI; // Remove unsupported modes _sounds = AudioUtils.CreateSounds(soundPaths, mode).ToArray(); _bus = RuntimeManager.GetBus(busPath); this.randomizeSounds = randomizeSounds; }
static void PatchAudio() { var thalassaceanRoarSounds = AudioUtils.CreateSounds(ECCAudio.CreateClipPool("ThalassaceanRoar").clips, k3DSoundModes).ToArray(); for (int i = 0; i < thalassaceanRoarSounds.Length; i++) { thalassaceanRoarSounds[i].set3DMinMaxDistance(5f, 80f); } var thalassaceanRoarEvent = new FModMultiSounds(thalassaceanRoarSounds, kCreatureSFXBus, true); CustomSoundHandler.RegisterCustomSound("ThalassaceanRoar", thalassaceanRoarEvent); var twisteelIdleSounds = AudioUtils.CreateSounds(ECCAudio.CreateClipPool("TwisteelIdle").clips, k3DSoundModes).ToArray(); for (int i = 0; i < twisteelIdleSounds.Length; i++) { twisteelIdleSounds[i].set3DMinMaxDistance(1f, 60f); } var twisteelIdleEvent = new FModMultiSounds(twisteelIdleSounds, kCreatureSFXBus, true); CustomSoundHandler.RegisterCustomSound("TwisteelIdle", twisteelIdleEvent); var twisteelBiteSounds = AudioUtils.CreateSounds(ECCAudio.CreateClipPool("TwisteelBite").clips, k3DSoundModes).ToArray(); for (int i = 0; i < twisteelBiteSounds.Length; i++) { twisteelBiteSounds[i].set3DMinMaxDistance(2f, 35f); } var twisteelBiteEvent = new FModMultiSounds(twisteelBiteSounds, kCreatureSFXBus, true); CustomSoundHandler.RegisterCustomSound("TwisteelBite", twisteelBiteEvent); var gulperRoarSounds = AudioUtils.CreateSounds(ECCAudio.CreateClipPool("GulperRoar").clips, k3DSoundModes).ToArray(); for (int i = 0; i < gulperRoarSounds.Length; i++) { gulperRoarSounds[i].set3DMinMaxDistance(2f, 100f); } var gulperRoarEvent = new FModMultiSounds(gulperRoarSounds, kCreatureSFXBus, true); CustomSoundHandler.RegisterCustomSound("GulperRoar", gulperRoarEvent); var gulperAttackSounds = AudioUtils.CreateSounds(ECCAudio.CreateClipPool("GulperAttack").clips, k3DSoundModes).ToArray(); for (int i = 0; i < gulperAttackSounds.Length; i++) { gulperAttackSounds[i].set3DMinMaxDistance(2f, 50f); } var gulperAttackEvent = new FModMultiSounds(gulperAttackSounds, kCreatureSFXBus, true); CustomSoundHandler.RegisterCustomSound("GulperAttack", gulperAttackEvent); var clownPincherIdleSounds = AudioUtils.CreateSounds(ECCAudio.CreateClipPool("ClownPincherIdle").clips, k3DSoundModes).ToArray(); for (int i = 0; i < clownPincherIdleSounds.Length; i++) { clownPincherIdleSounds[i].set3DMinMaxDistance(2f, 10f); } var clownPincherIdleEvent = new FModMultiSounds(clownPincherIdleSounds, kCreatureSFXBus, true); CustomSoundHandler.RegisterCustomSound("ClownPincherIdle", clownPincherIdleEvent); var clownPincherEatingSound = AudioUtils.CreateSound(assetBundle.LoadAsset <AudioClip>("ClownPincherEating"), k3DSoundModes); clownPincherEatingSound.set3DMinMaxDistance(1f, 12f); CustomSoundHandler.RegisterCustomSound("ClownPincherEating", clownPincherEatingSound, kCreatureSFXBus); var gulperSeamothSound = AudioUtils.CreateSound(assetBundle.LoadAsset <AudioClip>("GulperSeamoth1"), k3DSoundModes); CustomSoundHandler.RegisterCustomSound("GulperSeamoth", gulperSeamothSound, kCreatureSFXBus); var gulperExosuitSound = AudioUtils.CreateSound(assetBundle.LoadAsset <AudioClip>("GulperExosuit"), k3DSoundModes); CustomSoundHandler.RegisterCustomSound("GulperExosuit", gulperExosuitSound, kCreatureSFXBus); }