/// <summary> /// Create a new instance of <see cref="LoopbackProvider"/>. /// </summary> /// <param name="Device"><see cref="WasapiLoopbackDevice"/> to use.</param> /// <param name="IncludeSilence">Whether to record silence?... default = true</param> public LoopbackProvider(WasapiLoopbackDevice Device, bool IncludeSilence = true) { _deviceIndex = Device.DeviceIndex; _proc = Procedure; if (IncludeSilence) { _silencePlayer = new Silence(PlaybackDevice.Devices.First(Dev => Dev.Info.Driver == Device.Info.ID)); } BassWasapi.Init(_deviceIndex, Procedure: _proc); BassWasapi.CurrentDevice = Device.DeviceIndex; var info = BassWasapi.Info; WaveFormat = WaveFormat.CreateIeeeFloatWaveFormat(info.Frequency, info.Channels); }
/// <summary> /// Creates a new instance of <see cref="WasapiToBassStream"/>. /// </summary> /// <param name="Device"><see cref="WasapiLoopbackDevice"/> to use.</param> /// <param name="Decode">Whether to create a decoding channel.</param> public WasapiToBassStream(WasapiLoopbackDevice Device, bool Decode = false) : this(Device as WasapiDevice, Decode) { Device.Init(); }