Ejemplo n.º 1
0
        public AudioPreview(HCS_Encoder.AudioCapture CaptureDevice)
        {
            InitializeComponent();

            mic = CaptureDevice;
            mic.FrameAvailable += new EventHandler<HCS_Encoder.AudioDataEventArgs>(mic_FrameAvailable);
            this.SetClientSizeCore(640, 240);
            mic.Start();
        }
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();
            }
        }
Ejemplo n.º 3
0
        private void TestAudioSettings_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;

                MessageBox.Show("Audio device initialised OK.\r\nCapture settings may have been updated", "HCS Config");
            } catch {
                MessageBox.Show("Those settings don't work.\r\n(capture device refused to initialise, please check your device's documentation)", "HCS Config");
            } finally {
                if (mic != null) mic.Dispose();
            }
        }