public BASSWASAPIOutput(uint freq, uint chans, BASS.StreamProc proc, InitFlags flag, int device = -1, uint bufferLen = 0) { bool success = false; this.userStreamProc = proc; this.streamProc = WrapperStreamProc; // Init前から走っていたスレッドのIdを保持 var ids = GetThreadIdsArray(); // 初期化実行 success = BASS_WASAPI_Init(device, freq, chans, (uint)flag, (bufferLen / 1000.0F), 0.0F, streamProc, IntPtr.Zero); // 新しく生成されたスレッドを保持 bassThreadIDs.Union(ids.Except(GetThreadIdsArray())); if (!success) { throw new BASSWASAPIException(); } disposed = false; }
private static extern bool BASS_WASAPI_Init(int device, uint freq, uint chans, uint flags, float buffer, float period, WASAPIStreamProc proc, IntPtr user);