Ejemplo n.º 1
0
        private void Init_Audio_Settings()
        {
            SelectedAudioSource       = null;
            SelectedAac               = 0;
            SelectedAudioOutPutDevice = null;
            SelectedDocAudioSource    = null;
            SelectedSampleRate        = 0;


            AudioSource.Clear();
            DocAudioSource.Clear();
            AudioOutPutDevice.Clear();
            Aac.Clear();
            SampleRate.Clear();

            //设备

            var microphones = _meetingSdkAgent.GetMicrophones();

            var audioSourceList = microphones;
            var docSourceList   = microphones;

            var audioOutPutList = _meetingSdkAgent.GetLoudSpeakers();

            var sampleRateList = _settingParameter.AudioParameterSampleRates;
            var aac            = _settingParameter.AudioParameterAACs;

            //装载数据源
            audioSourceList.Result.ToList().ForEach(a => { AudioSource.Add(a); });
            docSourceList.Result.ToList().ForEach(d => { DocAudioSource.Add(d); });

            audioOutPutList.Result.ToList().ForEach(o => { AudioOutPutDevice.Add(o); });
            aac.ForEach(o => { Aac.Add(o.AAC); });
            sampleRateList.ForEach(o => { SampleRate.Add(o.SampleRate); });
            AudioSource.Add(string.Empty);
            DocAudioSource.Add(string.Empty);

            //设置默认选项
            SetDefaultAudioSetting();

            if (audioSourceList.Result.All(o => o != SelectedAudioSource))
            {
                SelectedAudioSource = string.Empty;
            }
            if (docSourceList.Result.All(o => o != SelectedDocAudioSource))
            {
                SelectedDocAudioSource = string.Empty;
            }
            if (audioOutPutList.Result.All(o => o != SelectedAudioOutPutDevice))
            {
                SelectedAudioOutPutDevice = string.Empty;
            }
        }