private void m_pToggleSend_Click(object sender,EventArgs e) { if(m_pAudioInRTP == null){ m_pSendStream = m_pSession.CreateSendStream(); m_pAudioInRTP = new AudioIn_RTP(AudioIn.Devices[m_pInDevices.SelectedIndex],20,m_pMainUI.AudioCodecs,m_pSendStream); m_pAudioInRTP.Start(); m_pTimer = new Timer(); m_pTimer.Interval = 500; m_pTimer.Tick += delegate(object s1,EventArgs e1){ m_pCodec.Text = m_pAudioInRTP.AudioCodec.Name; m_pPacketsSent.Text = m_pSendStream.RtpPacketsSent.ToString(); m_pKBSent.Text = Convert.ToString(m_pSendStream.RtpBytesSent / 1000); }; m_pTimer.Start(); m_pToggleSend.Text = "Stop"; } else{ m_pTimer.Dispose(); m_pTimer = null; m_pAudioInRTP.Dispose(); m_pAudioInRTP = null; m_pSendStream.Close(); m_pSendStream = null; m_pToggleSend.Text = "Send"; } }
private void btnCall_Click_1(object sender, RoutedEventArgs e) { IsConnected = false; m_pSession = m_pRtpSession.Sessions[0]; if (m_pAudioInRTP == null) { m_pSendStream = m_pSession.CreateSendStream(); } else { m_pAudioInRTP.Dispose(); m_pAudioInRTP = null; m_pSendStream.Close(); m_pSendStream = null; } // _soundSender.Start(); // _soundReceiver.Start(); }