Exemplo n.º 1
0
        private void RefreshList(Object sender, Windows.UI.Xaml.RoutedEventArgs evt)
        {
            AudioRenderEffectsManager   RenderEffectsManagerLocal;
            IReadOnlyList <AudioEffect> Effectslist;
            int deviceIndex = DevicesList.SelectedIndex;
            AudioRenderCategory Category;

            if (CategoriesList.SelectedIndex < 0)
            {
                Category = AudioRenderCategory.Communications;
            }
            else
            {
                Category = (AudioRenderCategory)CategoriesList.SelectedIndex;
            }

            if (deviceIndex < 0)
            {
                RenderEffectsManagerLocal = AudioEffectsManager.CreateAudioRenderEffectsManager(
                    MediaDevice.GetDefaultAudioRenderId(AudioDeviceRole.Communications),
                    Category,
                    Windows.Media.AudioProcessing.Default);
                lblEffects.DataContext = new EffectLabelView {
                    EffectLabelName = "Effects Active on {Default Device}"
                };
            }
            else
            {
                RenderEffectsManagerLocal = AudioEffectsManager.CreateAudioRenderEffectsManager(
                    m_DeviceInfo[deviceIndex].Id,
                    Category,
                    Windows.Media.AudioProcessing.Default);
                lblEffects.DataContext = new EffectLabelView {
                    EffectLabelName = "Effects Active on  {" + m_DeviceInfo[deviceIndex].Name + "}"
                };
            }

            Effectslist = RenderEffectsManagerLocal.GetAudioRenderEffects();
            DisplayEffectsList(Effectslist);
        }
Exemplo n.º 2
0
            public static void GetEQCurrent(EQInitialize eqinit)
            {
                var audio = AudioEffectsManager.CreateAudioRenderEffectsManager(MediaDevice.GetDefaultAudioRenderId(AudioDeviceRole.Default), Windows.Media.Render.AudioRenderCategory.Media);
                var asd   = new AudioEffectDefinition("sadawd");
                var supportedEncodingProperties        = new List <AudioEncodingProperties>();
                AudioEncodingProperties encodingProps1 = AudioEncodingProperties.CreatePcm(44100, 1, 32);

                encodingProps1.Subtype = MediaEncodingSubtypes.Float;
                AudioEncodingProperties encodingProps2 = AudioEncodingProperties.CreatePcm(48000, 1, 32);

                encodingProps2.Subtype = MediaEncodingSubtypes.Float;
                supportedEncodingProperties.Add(encodingProps1);
                supportedEncodingProperties.Add(encodingProps2);
                switch (eqinit)
                {
                case EQInitialize.无:
                    break;

                case EQInitialize.重低音强化:
                    break;

                case EQInitialize.低音强化:
                    break;

                case EQInitialize.高音强化:
                    break;

                case EQInitialize.古典音乐:
                    break;

                case EQInitialize.响度:
                    break;

                case EQInitialize.嘻哈:
                    break;

                case EQInitialize.声音强化:
                    break;

                case EQInitialize.摇滚:
                    break;

                case EQInitialize.流行音乐:
                    break;

                case EQInitialize.爵士:
                    break;

                case EQInitialize.电子:
                    break;

                case EQInitialize.舞曲:
                    break;

                case EQInitialize.节奏布鲁斯:
                    break;

                case EQInitialize.语音:
                    break;

                case EQInitialize.音响效果:
                    break;

                default:
                    break;
                }
            }
Exemplo n.º 3
0
        private void StartStopMonitor(Object sender, Windows.UI.Xaml.RoutedEventArgs evt)
        {
            if (m_MonitorStarted == true)
            {
                if (m_RenderEffectsManager != null)
                {
                    m_RenderEffectsManager.AudioRenderEffectsChanged -= OnRenderEffectsChanged;
                    m_RenderEffectsManager = null;
                }
                // No longer monitoring effects changes; re-enable button for "Refresh Effects List"
                btnRefreshEffects.IsEnabled = true;
                // Reset effects list to empty
                lblEffects.DataContext = new EffectLabelView {
                    EffectLabelName = "Effects"
                };
                DisplayEmptyEffectsList();
                m_MonitorStarted            = false;
                btnStartStopMonitor.Content = "Start Monitoring";
            }
            else
            {
                int deviceIndex = DevicesList.SelectedIndex;
                AudioRenderCategory Category;

                if (CategoriesList.SelectedIndex < 0)
                {
                    Category = AudioRenderCategory.Communications;
                }
                else
                {
                    Category = (AudioRenderCategory)CategoriesList.SelectedIndex;
                }

                if (deviceIndex < 0)
                {
                    m_RenderEffectsManager = AudioEffectsManager.CreateAudioRenderEffectsManager(
                        MediaDevice.GetDefaultAudioRenderId(AudioDeviceRole.Communications),
                        Category,
                        Windows.Media.AudioProcessing.Default);
                    m_RenderEffectsManager.AudioRenderEffectsChanged += OnRenderEffectsChanged;
                    lblEffects.DataContext = new EffectLabelView {
                        EffectLabelName = "Effects Active on {Default Device}"
                    };
                }
                else
                {
                    m_RenderEffectsManager = AudioEffectsManager.CreateAudioRenderEffectsManager(
                        m_DeviceInfo[deviceIndex].Id,
                        Category,
                        Windows.Media.AudioProcessing.Default);
                    m_RenderEffectsManager.AudioRenderEffectsChanged += OnRenderEffectsChanged;
                    lblEffects.DataContext = new EffectLabelView {
                        EffectLabelName = "Effects Active on  {" + m_DeviceInfo[deviceIndex].Name + "}"
                    };
                }

                // Display current effects once
                IReadOnlyList <AudioEffect> Effectslist = m_RenderEffectsManager.GetAudioRenderEffects();
                DisplayEffectsList(Effectslist);

                // Start monitoring effects changes; for now disable button for "Refresh Effects List"
                btnRefreshEffects.IsEnabled = false;
                m_MonitorStarted            = true;
                btnStartStopMonitor.Content = "Stop Monitoring";
            }
        }