Sound ICustomSoundHandler.RegisterCustomSound(string id, AudioClip audio, SoundChannel soundChannel) { var sound = AudioUtils.CreateSound(audio); CustomSoundPatcher.CustomSounds[id] = sound; CustomSoundPatcher.CustomSoundChannels[id] = soundChannel; return(sound); }
/// <summary> /// Register a Custom sound by file path. Some vanilla game sounds can be overridden by matching the id to the <see cref="FMODAsset.path"/>. /// </summary> /// <param name="id">The Id of your custom sound which is used when checking which sounds to play.</param> /// <param name="filePath">The file path on disk of the sound file to load.</param> /// <param name="bus">The bus to play the sound on.</param> /// <returns>the <see cref="Sound"/> loaded</returns> Sound ICustomSoundHandler.RegisterCustomSound(string id, string filePath, Bus bus) { Sound sound = AudioUtils.CreateSound(filePath); CustomSoundPatcher.CustomSounds[id] = sound; CustomSoundPatcher.CustomSoundBuses[id] = bus; return(sound); }
/// <summary> /// Register a custom sound by an <see cref="AudioClip"/> instance. Some vanilla game sounds can be overridden by matching the id to the <see cref="FMODAsset.path"/>. /// </summary> /// <param name="id">The Id of your custom sound which is used when checking which sounds to play.</param> /// <param name="audio">The AudioClip to register.</param> /// <param name="bus">The bus to play the sound on.</param> /// <returns>the <see cref="Sound"/> loaded</returns> Sound ICustomSoundHandler.RegisterCustomSound(string id, AudioClip audio, Bus bus) { var sound = AudioUtils.CreateSound(audio); CustomSoundPatcher.CustomSounds[id] = sound; CustomSoundPatcher.CustomSoundBuses[id] = bus; return(sound); }
Sound ICustomSoundHandler.RegisterCustomSound(string id, string filePath, SoundChannel soundChannel) { Sound sound = AudioUtils.CreateSound(filePath); CustomSoundPatcher.CustomSounds[id] = sound; CustomSoundPatcher.CustomSoundChannels[id] = soundChannel; return(sound); }
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); }