コード例 #1
0
        private static ReverbEffectDefinition CreateSmallRoom(AudioGraph graph)
        {
            ReverbEffectDefinition reverbEffectDefinition = new ReverbEffectDefinition(graph);

            reverbEffectDefinition.WetDryMix           = 100;
            reverbEffectDefinition.ReflectionsDelay    = 5;
            reverbEffectDefinition.ReverbDelay         = 10;
            reverbEffectDefinition.RearDelay           = 5;
            reverbEffectDefinition.PositionLeft        = 6;
            reverbEffectDefinition.PositionRight       = 6;
            reverbEffectDefinition.PositionMatrixLeft  = 27;
            reverbEffectDefinition.PositionMatrixRight = 27;
            reverbEffectDefinition.EarlyDiffusion      = 15;
            reverbEffectDefinition.LateDiffusion       = 15;
            reverbEffectDefinition.LowEQGain           = 8;
            reverbEffectDefinition.LowEQCutoff         = 4;
            reverbEffectDefinition.HighEQGain          = 8;
            reverbEffectDefinition.HighEQCutoff        = 6;
            reverbEffectDefinition.RoomFilterFreq      = 5000;
            reverbEffectDefinition.RoomFilterMain      = -10;
            reverbEffectDefinition.RoomFilterHF        = -6;
            reverbEffectDefinition.ReflectionsGain     = -4;
            reverbEffectDefinition.ReverbGain          = 5;
            reverbEffectDefinition.DecayTime           = 1.10;
            reverbEffectDefinition.Density             = 100;
            reverbEffectDefinition.RoomSize            = 100;
            reverbEffectDefinition.DisableLateField    = false;

            return(reverbEffectDefinition);
        }
コード例 #2
0
ファイル: AudioGraph.cs プロジェクト: zxw567/Aurora.Music
        private void InitEffects()
        {
            reverbEffect = new ReverbEffectDefinition(audioGraph)
            {
                WetDryMix        = 50,
                ReflectionsDelay = 12,
                ReverbDelay      = 30,
                RearDelay        = 3,
                DecayTime        = 2,
            };
            limiterEffect = new LimiterEffectDefinition(audioGraph)
            {
                Loudness = 1000,
                Release  = 10
            };
            eqEffect = new EqualizerEffectDefinition(audioGraph);


            eqEffect.Bands[0].FrequencyCenter = 150.0f;
            eqEffect.Bands[0].Gain            = 4.033f;
            eqEffect.Bands[0].Bandwidth       = 2f;

            eqEffect.Bands[1].FrequencyCenter = 300.0f;
            eqEffect.Bands[1].Gain            = 1.6888f;
            eqEffect.Bands[1].Bandwidth       = 2f;

            eqEffect.Bands[2].FrequencyCenter = 6000.0f;
            eqEffect.Bands[2].Gain            = 2.4702f;
            eqEffect.Bands[2].Bandwidth       = 2f;

            eqEffect.Bands[3].FrequencyCenter = 12000.0f;
            eqEffect.Bands[3].Gain            = 5.5958f;
            eqEffect.Bands[3].Bandwidth       = 2f;
        }
コード例 #3
0
        private void ConfigureSubmix()
        {
            //Create the submix node for the reverb
            _submixNode = _graph.CreateSubmixNode();
            _submixNode.OutgoingGain = 0.125d;
            //Add the submix node to the DeviceOutput.
            _submixNode.AddOutgoingConnection(_deviceOutput);
            //Add Reverb to the Submix
            ReverbEffectDefinition reverb = ReverbEffectDefinitionFactory.GetReverbEffectDefinition(_graph, ReverbEffectDefinitions.SmallRoom);

            _submixNode.EffectDefinitions.Add(reverb);
        }
コード例 #4
0
 //
 private void CreateReverbEffect()
 {
     // Create reverb effect
     reverbEffectDefinition = new ReverbEffectDefinition(audGraph);
     //
     // See the MSDN page for parameter explanations
     // https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xaudio2.xaudio2fx_reverb_parameters(v=vs.85).aspx
     reverbEffectDefinition.WetDryMix        = 50;
     reverbEffectDefinition.ReflectionsDelay = 120;
     reverbEffectDefinition.ReverbDelay      = 30;
     reverbEffectDefinition.RearDelay        = 3;
     reverbEffectDefinition.DecayTime        = 2;
     //
     audioDeviceOutputSubmixNode.EffectDefinitions.Add(reverbEffectDefinition);
     audioDeviceOutputSubmixNode.DisableEffectsByDefinition(reverbEffectDefinition);
 }
コード例 #5
0
        public static ReverbEffectDefinition GetReverbEffectDefinition(AudioGraph graph, ReverbEffectDefinitions reverbEffect)
        {
            ReverbEffectDefinition effect = null;

            switch (reverbEffect)
            {
            case ReverbEffectDefinitions.SmallRoom:
            {
                effect = CreateSmallRoom(graph);
                break;
            }

            case ReverbEffectDefinitions.LargeRoom:
            {
                effect = CreateLargeRoom(graph);
                break;
            }
            }

            return(effect);
        }
コード例 #6
0
        private void InitializeEffects()
        {
            _echoEffect   = new EchoEffectDefinition(graph);
            _reverbEffect = new ReverbEffectDefinition(graph);

            _echoEffect.Delay    = echoDelayMinVal;
            _echoEffect.Feedback = echoFeedbackMinVal;

            _reverbEffect.DecayTime  = reverbDecayMinVal;
            _reverbEffect.Density    = reverbDensityMinVal;
            _reverbEffect.ReverbGain = reverbGainMinVal;

            _reverbEffect.WetDryMix        = reverbWetDryMixDefaultVal;
            _reverbEffect.ReverbDelay      = (byte)reverbDelayDefaultVal;
            _reverbEffect.RearDelay        = (byte)reverbRearDelayDefaultVal;
            _reverbEffect.RoomSize         = reverbRoomSizeDefaultVal;
            _reverbEffect.ReflectionsDelay = (byte)reverbReflectionsDelayDefaultVal;
            _reverbEffect.LowEQCutoff      = (byte)reverbLowEqCutoffDefaultVal;
            _reverbEffect.LowEQGain        = (byte)reverbLowEqGainDefaultVal;
            _reverbEffect.HighEQCutoff     = (byte)reverbHighEqCutoffDefaultVal;
            _reverbEffect.HighEQGain       = (byte)reverbHighEqGainDefaultVal;
        }
        private void CreateReverbEffect()
        {
            // Create reverb effect
            reverbEffectDefinition = new ReverbEffectDefinition(graph);

            // See the MSDN page for parameter explanations
            // https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xaudio2.xaudio2fx_reverb_parameters(v=vs.85).aspx
            reverbEffectDefinition.WetDryMix          = 50;
            reverbEffectDefinition.ReflectionsDelay   = 120;
            reverbEffectDefinition.ReverbDelay        = 30;
            reverbEffectDefinition.RearDelay          = 3;
            reverbEffectDefinition.DecayTime          = 2;

            fileInputNode.EffectDefinitions.Add(reverbEffectDefinition);
            fileInputNode.DisableEffectsByDefinition(reverbEffectDefinition);
        }