private void comboBoxInputDevice_SelectedIndexChanged(object sender, EventArgs e) { /* if (inputDev) * { * //Get the device index from the selected device * DeviceInfo info = (DeviceInfo)comboBoxInputDevice.Items[comboBoxInputDevice.SelectedIndex]; * if (info == null) return; * * WasapiDevice.Stop(); * * WasapiDevice.SetDevice(info.WasapiDeviceNum, WasapiDevice.GetOutputDefaultDevice(), this); * WasapiDevice.Start(); * * }*/ try { if (m_inputDev) { if (Player.IsAsioInitialized) { BassAsioDevice.inputDevice = comboBoxInputDevice.SelectedIndex; //groupMicrophoneEffects.Visible = false; BASS_ASIO_CHANNELINFO chanInfo = BassAsio.BASS_ASIO_ChannelGetInfo(true, comboBoxInputDevice.SelectedIndex * 2); BassAsioDevice.Stop(); BassAsioDevice.SetDevice(comboBoxInputDevice.SelectedIndex * 2, comboBoxOutputDevice.SelectedIndex * 2); BassAsioDevice.Start(); Effects.GetorSetFx = Effects.Load.CHANNETSTRIP; RefreshEffects(); // groupMicrophoneEffects.Visible = true; m_inputDev = false; m_outputDev = false; } if (Player.IsWasapiInitialized) { //Get the device index from the selected device DeviceInfo info = (DeviceInfo)comboBoxInputDevice.Items[comboBoxInputDevice.SelectedIndex]; if (info == null) { return; } WasapiDevice.Stop(); WasapiDevice.SetDevice(info.WasapiDeviceNum, WasapiDevice.GetOutputDefaultDevice()); WasapiDevice.Start(); } } } catch (Exception ex) { Logger.LogFile(ex.Message, "", "comboBoxInputDevice_SelectedIndexChanged", ex.LineNumber(), this.Name); } }
/// <summary> /// Starts the Channel Playback. /// </summary> public bool Play() { _wasapiDevice.Start(); return(Bass.ChannelPlay(Handle)); }