/* Below here resides the audio code for communicating with other peers over the network. The code in this section will eventually be moved over to the 'voice.cs' class after the feature has been confirmed to work nicely. */ private void Btn_Start_Click(object sender, EventArgs e) { Btn_Start.Enabled = false; Btn_Stop.Enabled = true; string peerAddress = Txt_ServAddress.Text; int bitRate = int.Parse(CmbBox_SampleRate.Text); int bitDepth = int.Parse(CmbBox_BitDepth.Text); int deviceID = Cmb_InputDevices.SelectedIndex; ReceiveVoice rv = new ReceiveVoice(); Thread listenerThread = new Thread(new ThreadStart(rv.startListening)); listenerThread.Start(); Btn_StartAudioList.Text = "Listening"; Btn_StartAudioList.BackColor = System.Drawing.Color.Green; Thread.Sleep(1000); SendOutVoice sov = new SendOutVoice(peerAddress, deviceID, bitRate, bitDepth); Thread senderThread = new Thread(new ThreadStart(sov.StartSending)); senderThread.Start(); }
static void Main(string[] args) { SendOutVoice mine = new SendOutVoice(); mine.StartSending(); }