public abstract void Play(AudioDevice dev);
public virtual void Setup(AudioDevice dev) { dev.SetFormat(Format, Channels, Rate); }
public override void Play(AudioDevice dev) { ThreadUtils.StartBackgroundThread(WaitStopEvent); var count = _dataLen; _stream.Position = 100; while (!IsStopped && count > 0) { var read = _stream.Read(s_sampleBuffer, 0, Math.Min(BUFFER_SIZE, count)); if (read <= 0) break; count -= read; dev.PlaySample(s_sampleBuffer, read / _frameDivider); } if (IsStopped) dev.StopPlaying(); else dev.WaitForPlayingFinished(); dev.Close(); PlayingFinishedEvent.Set(); }