Пример #1
0
        private void sndTestCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            ItemData input  = (ItemData)sndinputComboBox.SelectedItem;
            ItemData output = (ItemData)sndoutputComboBox.SelectedItem;

            if (sndTestCheckBox.Checked)
            {
                //Extract input device and get its default samplerate.
                //WASAPI devices only support one sample rate so it's important to use the correct one.
                SoundDevice[] devs;
                TeamTalk.GetSoundDevices(out devs);

                int in_samplerate = 0;
                foreach (SoundDevice dev in devs)
                {
                    if (dev.nDeviceID == input.id)
                    {
                        in_samplerate = dev.nDefaultSampleRate;
                    }
                }

                SpeexDSP spxdsp = new SpeexDSP(true);
                spxdsp.bEnableAGC              = true;
                spxdsp.bEnableDenoise          = true;
                spxdsp.bEnableEchoCancellation = echocancelCheckBox.Checked;
                soundloop = TeamTalk.StartSoundLoopbackTest(input.id, output.id, in_samplerate, 1, duplexCheckBox.Checked, spxdsp);
                if (soundloop == IntPtr.Zero)
                {
                    MessageBox.Show("Failed to test selected device");
                    sndTestCheckBox.Checked = false;
                }
            }
            else
            {
                TeamTalk.CloseSoundLoopbackTest(soundloop);
            }
        }
Пример #2
0
 private void PreferencesDlg_FormClosing(object sender, FormClosingEventArgs e)
 {
     TeamTalk.CloseSoundLoopbackTest(soundloop);
 }