public static IOutputDevice CreateOutputDevice(OutputDevice.StreamProc streamProc, uint freq, uint chans, bool useFloat, int bufferLen, string preferredDeviceName = null) { lock (outputChannelLock) { Logger.Debug("Rebuild output"); if (Lutea.Core.AppCore.EnableWASAPIExclusive) { try { var ret = new BASSWASAPIOutputChannel(streamProc, true, freq, chans, preferredDeviceName, (uint)bufferLen); BASS.SetPriority(System.Diagnostics.ThreadPriorityLevel.TimeCritical); BASSWASAPIOutput.SetPriority(System.Diagnostics.ThreadPriorityLevel.TimeCritical); return(ret); } catch (BASSWASAPIOutput.BASSWASAPIException) { } } try { var ret = new BASSWASAPIOutputChannel(streamProc, false, freq, chans, preferredDeviceName, (uint)bufferLen); BASS.SetPriority(System.Diagnostics.ThreadPriorityLevel.TimeCritical); BASSWASAPIOutput.SetPriority(System.Diagnostics.ThreadPriorityLevel.TimeCritical); return(ret); } catch (BASSWASAPIOutput.BASSWASAPIException) { } try { var ret = new BASSOutput(streamProc, freq, chans, preferredDeviceName, bufferLen); BASS.SetPriority(System.Diagnostics.ThreadPriorityLevel.TimeCritical); return(ret); } catch (BASS.BASSException) { } throw new NotSupportedException(); } }
public uint GetDataFFT(float[] buffer, Controller.FFTNum fftNum) { return(BassWasapiOutput.GetDataFFT(buffer, BASSOutput.MapFFTEnum(fftNum))); }