void ShowMicDeviceWindow() { // Let the user choose a microphone device UI.WindowBegin("Available Microphones:", ref micSelectPose); // User may plug or unplug a mic device, so it's nice to be able to // refresh this list. if (UI.Button("Refresh") || micDevices == null) { micDevices = Microphone.GetDevices(); } UI.HSeparator(); // Display the list of potential microphones. Some systems may only // have the default (null) device available. Vec2 size = V.XY(0.25f, UI.LineHeight); if (UI.Radio("Default", micDeviceActive == null, size)) { micDeviceActive = null; Microphone.Start(micDeviceActive); } foreach (string device in micDevices) { if (UI.Radio(device, micDeviceActive == device, size)) { micDeviceActive = device; Microphone.Start(micDeviceActive); } } UI.WindowEnd(); }
public async Task Load_Devices() { await Task.Run(() => { _microInfos = Microphone.GetDevices(); _speakerInfos = Speaker.GetDevices(); }); }
private void WyborMikrofonu() { int i = 0; microphone = (Microphone)System.Windows.Application.Current.Properties["WejscieAudio"]; foreach (var device in Microphone.GetDevices()) { AudioINcomboBox.Items.Add(device); if (microphone.DeviceInfo.ToString() == device.ProductName) { AudioINcomboBox.SelectedIndex = i; } i++; } }
private void callWelcome_Load(object sender, EventArgs e) { sipClient sipClient = (from p in Application.OpenForms.OfType <sipClient>() select p).FirstOrDefault(); wsc.getAgentAnnounces(); ComboBox skills = sipClient.agentSkill; foreach (sipClient.ComboboxItem skill in skills.Items) { recordSkills.Items.Add(skill.Text); } Microphone.GetDevices().ForEach(delegate(Ozeki.Media.Audio.DeviceInfo mic) { mics.Items.Add(mic.ProductName); if (mic.ProductName == main.defMicrophone) { mics.SelectedItem = main.defMicrophone; } }); Speaker.GetDevices().ForEach(delegate(Ozeki.Media.Audio.DeviceInfo speaker) { speakers.Items.Add(speaker.ProductName); if (speaker.ProductName == main.defSpeaker) { speakers.SelectedItem = main.defSpeaker; } }); foreach (Ozeki.Media.Codec.CodecInfo codec in sipClient.softphone.Codecs) { audioCodecs.Items.Add(codec.CodecName); if (codec.CodecName == main.defAudioCodec) { audioCodecs.SelectedItem = main.defAudioCodec; } videoCodecs.Items.Add(codec.CodecName); if (codec.CodecName == main.defVideoCodec) { videoCodecs.SelectedItem = main.defVideoCodec; } } //sipClient.audioProcessor.AutoGainControl = true; //sipClient.audioProcessor.GainSpeed = ; }
public static void loadActions() { try { sipClient sipClient = (from p in Application.OpenForms.OfType <sipClient>() select p).FirstOrDefault(); sipClient.answerPanel.Visible = false; sipClient.downloadBar.Visible = false; Screen myScreen = Screen.PrimaryScreen; Ozeki.VoIP.SDK.Protection.LicenseManager.Instance.SetLicense("OZSDK-DNA2CALL-151119-282F5AEA", "TUNDOjIsTVBMOjIsRzcyOTp0cnVlLE1TTEM6MixNRkM6MixVUDoyMDE2LjExLjE5LFA6MjE5OS4wMS4wMXxGdnd4ZEt6SnFRbzI1eXdvMmpVaVkrdVVscUpoRXg0OGNta2w4WDYzMGFJMENOWkx4dmtobXgrWURXMERaQjAwNHcvbE4xL25FYnpORGh2Qm5WUWdXZz09"); sipClient.softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000); sipClient.statusScreen.Text = "Started"; sipClient.Height = myScreen.WorkingArea.Height; sipClient.Location = new Point(getStartPosition(sipClient.Width), 0); logAdd("", 1, "Application Started"); bool result = registerToSIP(); if (result == true) { sipClient.phoneLine1.RegistrationStateChanged += sipClient.sipAccount_RegStateChanged; sipClient.softphone.IncomingCall += sipClient.softphone_IncomingCall; sipClient.sipMessageLogger = new SIPMessageLogger(); sipClient.sipMessageLogger.SIPMessageReceived += (sipClient.sipMessageLogger_SIPMessageReceived); bool microphoneSuccess = false; Microphone.GetDevices().ForEach(delegate(Ozeki.Media.Audio.DeviceInfo mic) { if (mic.ProductName.Contains(defMicrophone)) { sipClient.microphone = Microphone.GetDevice(mic); MessageBox.Show("Mikrofon seçildi = " + mic.ProductName.ToString()); microphoneSuccess = true; } }); bool speakerSuccess = false; Speaker.GetDevices().ForEach(delegate(Ozeki.Media.Audio.DeviceInfo speaker) { if (speaker.ProductName.Contains(defSpeaker)) { sipClient.speaker = Speaker.GetDevice(speaker); MessageBox.Show("Kulaklık seçildi = " + speaker.ProductName.ToString()); speakerSuccess = true; } }); if (microphoneSuccess == false) { sipClient.microphone = Microphone.GetDefaultDevice(); main.errorModal("Daha önce seçtğiniz " + defMicrophone + " adlı cihaz şuan bu PC'ye bağlı değil. Bu sebeple varsayılan mikrofon seçildi."); } if (speakerSuccess == false) { sipClient.speaker = Speaker.GetDefaultDevice(); main.errorModal("Daha önce seçtğiniz " + defSpeaker + " adlı cihaz şuan bu PC'ye bağlı değil. Bu sebeple varsayılan kulaklık/hoparlör seçildi."); } sipClient.mediaReceiver = new PhoneCallAudioReceiver(); sipClient.mediaSender = new PhoneCallAudioSender(); sipClient.connector = new MediaConnector(); disableAllAudioCodecs(); disableAllVideoCodecs(); enableAudioCodec(defAudioCodec); enableVideoCodec(defVideoCodec); wsc.getAgentAnnounces(); } } catch (Exception err) { errorModal("LoadActions: " + err.Message.ToString()); } }