Exemple #1
0
 public void CanEnumerateAudioEffects()
 {
     Debug.WriteLine("Audio Effects:");
     foreach (var dmo in DmoEnumerator.GetAudioEffectNames())
     {
         Debug.WriteLine(string.Format("{0} {1}", dmo.Name, dmo.Clsid));
         var mediaObject = Activator.CreateInstance(Type.GetTypeFromCLSID(dmo.Clsid));
     }
 }
Exemple #2
0
        /// <summary>
        /// Create new DMO ParamEq
        /// </summary>
        public DmoParamEq()
        {
            var guidParamEq = new Guid("120CED89-3BF4-4173-A132-3CB406CF3231");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidParamEq));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFxParamEq)mediaComObject);
            }
        }
        /// <summary>
        /// Create new DMO Echo
        /// </summary>
        public DmoEcho()
        {
            var guidEcho = new Guid("EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidEcho));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFXEcho)mediaComObject);
            }
        }
Exemple #4
0
        /// <summary>
        /// Create new DMO Compressor
        /// </summary>
        public DmoCompressor()
        {
            var guidChorus = new Guid("EF011F79-4000-406D-87AF-BFFB3FC39D57");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidChorus));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFXCompressor)mediaComObject);
            }
        }
        /// <summary>
        /// Create new DMO Distortion
        /// </summary>
        public DmoDistortion()
        {
            var guidDistortion = new Guid("EF114C90-CD1D-484E-96E5-09CFAF912A21");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidDistortion));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFXDistortion)mediaComObject);
            }
        }
Exemple #6
0
        /// <summary>
        /// Create new DMO Flanger
        /// </summary>
        public DmoFlanger()
        {
            var guidFlanger = new Guid("EFCA3D92-DFD8-4672-A603-7420894BAD98");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidFlanger));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFXFlanger)mediaComObject);
            }
        }
        /// <summary>
        /// Create new DMO Gargle
        /// </summary>
        public DmoGargle()
        {
            var guidGargle = new Guid("DAFD8210-5711-4B91-9FE3-F75B7AE279BF");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidGargle));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFXGargle)mediaComObject);
            }
        }
        /// <summary>
        /// Create new DMO Chorus
        /// </summary>
        public DmoChorus()
        {
            var guidChorus = new Guid("EFE6629C-81F7-4281-BD91-C9D604A95AF6");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidChorus));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFXChorus)mediaComObject);
            }
        }
Exemple #9
0
        /// <summary>
        /// Create new DMO WavesReverb
        /// </summary>
        public DmoWavesReverb()
        {
            var guidWavesReverb = new Guid("87FC0268-9A55-4360-95AA-004A1D9DE26C");

            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guidWavesReverb));

            if (targetDescriptor != null)
            {
                var mediaComObject = Activator.CreateInstance(Type.GetTypeFromCLSID(targetDescriptor.Clsid));

                mediaObject        = new MediaObject((IMediaObject)mediaComObject);
                mediaObjectInPlace = new MediaObjectInPlace((IMediaObjectInPlace)mediaComObject);
                effectParams       = new Params((IDirectSoundFXWavesReverb)mediaComObject);
            }
        }
Exemple #10
0
        public void CanCreateDmoGargle()
        {
            var guid             = new Guid("DAFD8210-5711-4B91-9FE3-F75B7AE279BF");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoGargle())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #11
0
        public void CanCreateDmoEcho()
        {
            var guid             = new Guid("EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoEcho())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #12
0
        public void CanCreateDmoFlanger()
        {
            var guid             = new Guid("EFCA3D92-DFD8-4672-A603-7420894BAD98");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoFlanger())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #13
0
        public void CanCreateDmoChorus()
        {
            var guid             = new Guid("EFE6629C-81F7-4281-BD91-C9D604A95AF6");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoChorus())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #14
0
        public void CanCreateDmoWavesReverb()
        {
            var guid             = new Guid("87FC0268-9A55-4360-95AA-004A1D9DE26C");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoWavesReverb())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #15
0
        public void CanCreateDmoI3DL2Reverb()
        {
            var guid             = new Guid("EF985E71-D5C7-42D4-BA4D-2D073E2E96F4");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoI3DL2Reverb())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #16
0
        public void CanCreateDmoParamEq()
        {
            var guid             = new Guid("120CED89-3BF4-4173-A132-3CB406CF3231");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoParamEq())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #17
0
        public void CanCreateDmoCompressor()
        {
            var guid             = new Guid("EF011F79-4000-406D-87AF-BFFB3FC39D57");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoCompressor())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }
Exemple #18
0
        public void CanCreateDmoDistortion()
        {
            var guid             = new Guid("EF114C90-CD1D-484E-96E5-09CFAF912A21");
            var targetDescriptor = DmoEnumerator.GetAudioEffectNames().First(descriptor =>
                                                                             Equals(descriptor.Clsid, guid));

            using (var dmoGargle = new DmoDistortion())
            {
                if (targetDescriptor == null)
                {
                    // is not support
                    Assert.IsNull((object)dmoGargle.MediaObject);
                    Assert.IsNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNull((object)dmoGargle.EffectParams);
                }
                else
                {
                    Assert.IsNotNull((object)dmoGargle.MediaObject);
                    Assert.IsNotNull((object)dmoGargle.MediaObjectInPlace);
                    Assert.IsNotNull((object)dmoGargle.EffectParams);
                }
            }
        }