/// <summary> /// 初始化声卡麦克风 /// </summary> private void InitializeMixing() { try { this.trackBarIn.Scroll += new EventHandler(trackBarOut_Scroll); this.trackBarOut.Scroll += new EventHandler(trackBarOut_Scroll); mixerF.MixerControlChange += new EventHandler(mixer_MixerControlChange); this.outdtl = new Mixer.MixerControlDetail(mixerF, Mixer.MIXERLINE_COMPONENTTYPE_DST_SPEAKERS); this.trackBarOut.Minimum = this.outdtl.Min; this.trackBarOut.Maximum = this.outdtl.Max; this.trackBarOut.Value = this.outdtl.Volume; this.indtl = new Mixer.MixerControlDetail(mixerF, Mixer.MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE); this.trackBarIn.Minimum = indtl.Min; this.trackBarIn.Maximum = indtl.Max; this.trackBarIn.Value = this.indtl.Volume; m_pWaveIn = new LumiSoft.Media.Wave.WaveIn(LumiSoft.Media.Wave.WaveIn.Devices[0], 8000, 16, 1, 400); m_pWaveIn.BufferFull += new LumiSoft.Media.Wave.BufferFullHandler(m_pWaveIn_BufferFull); m_pWaveIn.Start(); } catch { } }
/// <summary> /// 初始化声卡麦克风 /// </summary> private void InitializeMixing() { try { this.trackBarIn.Scroll += new EventHandler(trackBarOut_Scroll); this.trackBarOut.Scroll += new EventHandler(trackBarOut_Scroll); mixerF.MixerControlChange += new EventHandler(mixer_MixerControlChange); this.outdtl = new Mixer.MixerControlDetail(mixerF, Mixer.MIXERLINE_COMPONENTTYPE_DST_SPEAKERS); this.trackBarOut.Minimum = this.outdtl.Min; this.trackBarOut.Maximum = this.outdtl.Max; this.trackBarOut.Value = this.outdtl.Volume; this.indtl = new Mixer.MixerControlDetail(mixerF, Mixer.MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE); this.trackBarIn.Minimum = indtl.Min; this.trackBarIn.Maximum = indtl.Max; this.trackBarIn.Value = this.indtl.Volume; m_pWaveIn = new LumiSoft.Media.Wave.WaveIn(LumiSoft.Media.Wave.WaveIn.Devices[0], 8000, 16, 1, 400); m_pWaveIn.BufferFull += new LumiSoft.Media.Wave.BufferFullHandler(m_pWaveIn_BufferFull); m_pWaveIn.Start(); } catch { } }