public WasapiIn(bool loopback = true, ShareMode shareMode = ShareMode.Shared, bool eventSync = false, Role role = Role.Multimedia, int durationMillisecond = 30) { wasapi = new Wasapi( Wasapi.GetDefaultDevice(loopback ? DataFlow.Render : DataFlow.Capture, role), loopback ? StreamFlags.StreamFlagsLoopback : StreamFlags.None, shareMode, eventSync, durationMillisecond); }
/// <summary> /// WASAPI音频输出 /// </summary> /// <param name="shareMode">指定共享模式或独占模式</param> /// <param name="eventSync">是否使用事件同步</param> /// <param name="role">指定应用场景</param> /// <param name="durationMillisecond">缓冲区周期时间</param> public WasapiOut(ShareMode shareMode, bool eventSync = true, Role role = Role.Multimedia, int durationMillisecond = 100) { wasapi = new Wasapi(Wasapi.GetDefaultDevice(DataFlow.Render, role), StreamFlags.None, shareMode, eventSync, durationMillisecond); }