naudio / NAudio

Audio and MIDI library for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WaveOut.Play() Object reference not set to an instance of an object

ananadult opened this issue · comments

Hi, I'm using WaveOut Play() encountered an Object reference not set to an instance of an object I am well aware that when calling play, waveOut has already been initialized, and this phenomenon only occurs on a very small number of computers.
waveOut = new WaveOut() { DesiredLatency = 100 };
if (waveOut != null) { Comm.Log.LoggerHelper._.Info($"play and pause ,state:{state}"); if (state) waveOut.Play(); else waveOut.Pause(); }
May I ask what is causing this situation?
Thank you very much!