Ejemplo n.º 1
0
        private void AudioPreviewButton_Click(object sender, EventArgs e)
        {
            if (AudioDeviceMenu.SelectedIndex < 0)
            {
                MessageBox.Show("Please select a capture device first", "HCS Config");
                return;
            }
            HCS_Encoder.AudioCapture mic = null;
            try {
                mic = new HCS_Encoder.AudioCapture(AudioDeviceMenu.SelectedIndex,
                                                   (int)AudioCaptureRate.Value, (int)AudioChannelCount.Value);

                AudioChannelCount.Value = mic.Channels;
                AudioCaptureRate.Value  = mic.SampleRate;

                AudioPreview prev = new AudioPreview(mic);
                prev.ShowDialog();
            } catch {
                MessageBox.Show("Those settings don't work.\r\n(capture device refused to initialise, please check your device's documentation)", "HCS Config");
                if (mic != null)
                {
                    mic.Dispose();
                }
            }
        }
Ejemplo n.º 2
0
        private void AudioPreviewButton_Click(object sender, EventArgs e)
        {
            if (AudioDeviceMenu.SelectedIndex < 0) {
                MessageBox.Show("Please select a capture device first", "HCS Config");
                return;
            }
            HCS_Encoder.AudioCapture mic = null;
            try {
                mic = new HCS_Encoder.AudioCapture(AudioDeviceMenu.SelectedIndex,
                    (int)AudioCaptureRate.Value, (int)AudioChannelCount.Value);

                AudioChannelCount.Value = mic.Channels;
                AudioCaptureRate.Value = mic.SampleRate;

                AudioPreview prev = new AudioPreview(mic);
                prev.ShowDialog();
            } catch {
                MessageBox.Show("Those settings don't work.\r\n(capture device refused to initialise, please check your device's documentation)", "HCS Config");
                if (mic != null) mic.Dispose();
            }
        }