Пример #1
0
 public RecordExample() : base("Fmod Record Example")
 {
     RegisterCommand(ConsoleKey.D1, () =>
     {
         dspEnabled            = !dspEnabled;
         ReverbProperties prop = dspEnabled ? Preset.ConcertHall : Preset.Off;
         System.SetReverbProperties(0, in prop);
     });
 }
Пример #2
0
 private void UpdateProperties(ReverbProperties properties)
 {
     StaticPlayer.System.SetReverbProperties(1, properties);
     sliderDecayTime.Value    = Convert.ToInt32(properties.DecayTime);
     sliderEarlyDelay.Value   = Convert.ToInt32(properties.EarlyDelay);
     sliderLateDelay.Value    = Convert.ToInt32(properties.LateDelay);
     sliderHFReference.Value  = Convert.ToInt32(properties.HFReference);
     sliderHFDecayRatio.Value = Convert.ToInt32(properties.HFDecayRatio);
     sliderDiffusion.Value    = Convert.ToInt32(properties.Diffusion);
     sliderDensity.Value      = Convert.ToInt32(properties.Density);
     sliderLowShelfFreq.Value = Convert.ToInt32(properties.LowShelfFrequency);
     sliderLowShelfGain.Value = Convert.ToInt32(properties.LowShelfGain);
     sliderHighCut.Value      = Convert.ToInt32(properties.HighCut);
     sliderEarlyLateMix.Value = Convert.ToInt32(properties.EarlyLateMix);
     sliderWetLevel.Value     = Convert.ToInt32(properties.WetLevel);
 }
Пример #3
0
        private int createEffect(ReverbProperties reverbProperties)
        {
            EFX.GenEffect(out var efxEffect);
            EFX.Effect(efxEffect, EffectInteger.EffectType, (int)EffectType.EaxReverb);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbDensity, reverbProperties.Density);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbDiffusion, reverbProperties.Diffusion);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbGain, reverbProperties.Gain);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbGainHF, reverbProperties.GainHF);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbGainLF, reverbProperties.GainLF);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbDecayTime, reverbProperties.DecayTime);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbDecayHFRatio, reverbProperties.DecayHFRatio);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbDecayLFRatio, reverbProperties.DecayLFRatio);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbReflectionsGain, reverbProperties.ReflectionsGain);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbReflectionsDelay, reverbProperties.ReflectionsDelay);

            EFX.Effect(
                efxEffect,
                EffectVector3.EaxReverbReflectionsPan,
                new[] { reverbProperties.ReflectionsPan.X, reverbProperties.ReflectionsPan.Y, reverbProperties.ReflectionsPan.Z }
                );

            EFX.Effect(efxEffect, EffectFloat.EaxReverbLateReverbGain, reverbProperties.LateReverbGain);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbLateReverbDelay, reverbProperties.LateReverbDelay);

            EFX.Effect(
                efxEffect,
                EffectVector3.EaxReverbLateReverbPan,
                new[] { reverbProperties.LateReverbPan.X, reverbProperties.LateReverbPan.Y, reverbProperties.LateReverbPan.Z }
                );

            EFX.Effect(efxEffect, EffectFloat.EaxReverbEchoTime, reverbProperties.EchoTime);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbEchoDepth, reverbProperties.EchoDepth);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbModulationTime, reverbProperties.ModulationTime);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbModulationDepth, reverbProperties.ModulationDepth);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbAirAbsorptionGainHF, reverbProperties.AirAbsorptionGainHF);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbHFReference, reverbProperties.HFReference);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbLFReference, reverbProperties.LFReference);
            EFX.Effect(efxEffect, EffectFloat.EaxReverbRoomRolloffFactor, reverbProperties.RoomRolloffFactor);
            EFX.Effect(efxEffect, EffectInteger.EaxReverbDecayHFLimit, reverbProperties.DecayHFLimit);

            return(efxEffect);
        }
Пример #4
0
        private void Slider_Scroll(object sender, ScrollEventArgs e)
        {
            var properties = new ReverbProperties
            {
                DecayTime         = sliderDecayTime.Value,
                EarlyDelay        = sliderEarlyDelay.Value,
                LateDelay         = sliderLateDelay.Value,
                HFReference       = sliderHFReference.Value,
                HFDecayRatio      = sliderHFDecayRatio.Value,
                Diffusion         = sliderDiffusion.Value,
                Density           = sliderDensity.Value,
                LowShelfFrequency = sliderLowShelfFreq.Value,
                LowShelfGain      = sliderLowShelfGain.Value,
                HighCut           = sliderHighCut.Value,
                EarlyLateMix      = sliderEarlyLateMix.Value,
                WetLevel          = sliderWetLevel.Value
            };

            UpdateProperties(properties);
        }
Пример #5
0
 private static extern Result FMOD_Reverb3D_SetProperties(IntPtr reverb, ref ReverbProperties properties);
Пример #6
0
 public Result GetProperties(ref ReverbProperties properties)
 {
     return(FMOD_Reverb3D_GetProperties(RawPtr, ref properties));
 }
Пример #7
0
 private static extern Result FMOD_System_SetReverbProperties(IntPtr system, int instance, ref ReverbProperties prop);