static void usage(Capturer capturer) { Console.WriteLine("Usage : CaptureScreenCSharp.exe <outfilename> [left] [top] [width] [height] [fps] [v-codec] [a-codec] [audioline]\n"); Console.WriteLine("[left, top, width, height] is the rectangle to be captured"); Console.WriteLine("[v-codec] is the index of the video codec in the list to use."); Console.WriteLine("[a-codec] is the index of the audio codec in the list to use."); Console.WriteLine("[audioline] is the index of the audio line in the list to capture from"); Console.WriteLine("If either codec is unspecified, it defaults to 'Microsoft Video 1' and 'GSM 6.10'"); Console.WriteLine("If audioline is unspecified, it uses the microphone"); Console.WriteLine("To capture the currently playing output, select the stereo, mono or wave mix"); Console.WriteLine("Installed Video Codecs (Note : Not all of them may work)"); for (int i = 0; i < capturer.VideoCodecsCount; i++) { string name = capturer.GetVideoCodecName(i); Console.WriteLine(string.Format(" {0}. {1}", i, name)); } Console.WriteLine("\nInstalled Audio Codecs (Note : Not all of them may work)"); for (int i = 0; i < capturer.AudioCodecsCount; i++) { string name = capturer.GetAudioCodecName(i); Console.WriteLine(string.Format(" {0}. {1}", i, name)); } Console.WriteLine("\nAudio input lines"); for (int i = 0; i < capturer.CurrentAudioDeviceLineCount; i++) { string name = capturer.GetCurrentAudioDeviceLineName(i); Console.WriteLine(string.Format(" {0}. {1}", i, name)); } }
private void cmbAudioDevices_SelectedIndexChanged(object sender, EventArgs e) { if (_tempCapturer.AudioDeviceCount == 0) { return; } _tempCapturer.CurrentAudioDeviceName = cmbAudioDevices.SelectedItem.ToString(); cmbAudioLines.Items.Clear(); for (int i = 0; i < _tempCapturer.CurrentAudioDeviceLineCount; i++) { string line = _tempCapturer.GetCurrentAudioDeviceLineName(i); cmbAudioLines.Items.Add(line); } for (int i = 0; i < cmbAudioLines.Items.Count; i++) { if (cmbAudioLines.Items[i].ToString() == Program.Cfg.AudioLine) { cmbAudioLines.SelectedIndex = i; break; } } if (cmbAudioLines.SelectedIndex == -1) { for (int j = 0; j < cmbAudioLines.Items.Count; j++) { string tmpS = cmbAudioLines.Items[j].ToString().ToUpper(); if (tmpS.IndexOf("MIC") > -1) { cmbAudioLines.SelectedIndex = j; } } } if (cmbAudioLines.SelectedIndex == -1) { cmbAudioLines.SelectedItem = _tempCapturer.CurrentAudioDeviceLineName; Program.Cfg.AudioLine = _tempCapturer.CurrentAudioDeviceLineName; } }
private void cmbAudioDevices_SelectedIndexChanged(object sender, EventArgs e) { capturer.CurrentAudioDeviceName = cmbAudioDevices.SelectedItem.ToString(); cmbAudioLines.Items.Clear(); // Get list of available audio lines of current audio device for (int i = 0; i < capturer.CurrentAudioDeviceLineCount; i++) { string line = capturer.GetCurrentAudioDeviceLineName(i); cmbAudioLines.Items.Add(line); } // Select current audio line if (cmbAudioLines.Items.Count > 0) { cmbAudioLines.SelectedIndex = capturer.CurrentAudioDeviceLine; } }