Ejemplo n.º 1
0
        private void GetAudioDevices()
        {
            foreach (var inputDevice in ClientAudioUtilities.GetInputDevices())
            {
                audioInputDevice.Items.Add(inputDevice);
            }

            foreach (var outputDevice in ClientAudioUtilities.GetOutputDevices())
            {
                audioOutputDevice.Items.Add(outputDevice);
            }
        }
Ejemplo n.º 2
0
 public void OnPushToTalkStateChanged(object sender, PushToTalkStateChangedEventArgs e)
 {
     mPttActive = e.Down;
     if (mAfvUserClient.IsConnected && mAfvUserClient.Started && ClientAudioUtilities.IsInputDevicePresent())
     {
         if (mRadioStackState.IsCom1Transmitting)
         {
             ComRadioTransmittingChanged?.Invoke(this, new ComRadioTxRxChangedEventArgs(1, mPttActive));
         }
         if (mRadioStackState.IsCom2Transmitting)
         {
             ComRadioTransmittingChanged?.Invoke(this, new ComRadioTxRxChangedEventArgs(2, mPttActive));
         }
         mAfvUserClient.PTT(mPttActive);
     }
 }
Ejemplo n.º 3
0
 private void StartClientConnection()
 {
     try
     {
         if (!mAfvUserClient.Started)
         {
             if (!ClientAudioUtilities.IsInputDevicePresent())
             {
                 mOutputDeviceName         = mConfig.OutputDeviceName;
                 mAfvUserClient.Com1Volume = mConfig.Com1Volume;
                 mAfvUserClient.Com2Volume = mConfig.Com2Volume;
                 mAfvUserClient.Start(mOutputDeviceName, new List <ushort> {
                     1, 2
                 });
                 NotificationPosted?.Invoke(this, new NotificationPostedEventArgs(NotificationType.Error, "No audio input device was detected. xPilot will run in receive only mode."));
             }
             else
             {
                 mInputDeviceName             = mConfig.InputDeviceName;
                 mOutputDeviceName            = mConfig.OutputDeviceName;
                 mAfvUserClient.InputVolumeDb = mConfig.InputVolumeDb / 4;
                 mAfvUserClient.Com1Volume    = mConfig.Com1Volume;
                 mAfvUserClient.Com2Volume    = mConfig.Com2Volume;
                 mAfvUserClient.Start(mInputDeviceName, mOutputDeviceName, new List <ushort> {
                     1, 2
                 });
             }
             mAfvUserClient.BypassEffects = mConfig.DisableAudioEffects;
         }
         mUpdateTransceiverTimer.Start();
         PrepareTransceivers();
     }
     catch (Exception ex)
     {
         NotificationPosted?.Invoke(this, new NotificationPostedEventArgs(NotificationType.Error, "Error starting voice server client: " + ex.Message));
     }
 }