コード例 #1
0
        WasapiToBassStream(WasapiDevice WasapiDevice, bool Decode = false)
        {
            var info = WasapiDevice.Info;

            _wasapiDevice = WasapiDevice;

            Handle = Bass.CreateStream(info.MixFrequency, info.MixChannels, Decode ? BassFlags.Decode : 0, StreamProcedureType.Push);

            WasapiDevice.Callback += (B, L) => Bass.StreamPutData(Handle, B, L);
        }
コード例 #2
0
        WasapiToBassStream(WasapiDevice WasapiDevice, bool Decode = false)
        {
            var info = WasapiDevice.Info;

            _wasapiDevice = WasapiDevice;

            Handle = Bass.CreateStream(info.MixFrequency, info.MixChannels, Decode ? BassFlags.Decode : 0, StreamProcedureType.Push);

            WasapiDevice.Callback += (B, L) => Bass.StreamPutData(Handle, B, L);
        }
コード例 #3
0
        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);
            }
        }