Exemplo n.º 1
0
 public static LpsAudio INSTANCE(bool immersed = false)
 {
     if (LA_instance == null)
     {
         lock (LA_lock)
         {
             LA_instance = LA_instance ?? new LpsAudio(immersed);
         }
     }
     return(LA_instance);
 }
Exemplo n.º 2
0
        private bool disposedValue = false; // 要检测冗余调用

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (iws != null && wasapiOut != null)
                    {
                        Counter?.Abort();
                        wasapiOut.Stop();
                        wasapiOut.Dispose();
                        iws.Dispose();
                    }
                }

                // TODO: 释放未托管的资源(未托管的对象)并在以下内容中替代终结器。
                // TODO: 将大型字段设置为 null。
                disposedValue = true;
                LA_instance   = null;
            }
        }