public void TemporaryShutdown() { if (CurrentSourceVoice == null) { throw new Exception(); // TEMP } savedSamplesPlayed = (int)CurrentSourceVoice.SamplesPlayed; CurrentSourceVoice.Stop(); CurrentStream.Dispose(); }
/// <summary> /// Selects a track without playing it. If the stream is already selected, the player carries on. /// </summary> /// <param name="stream">The track to select.</param> public void Select(WaveStream stream) { if (CurrentStream != stream) { CurrentOut?.Dispose(); CurrentStream?.Dispose(); CurrentOut = new WaveOut(WaveCallbackInfo.FunctionCallback()); // using the function callback makes playback independent of GUI thread, apparently CurrentOut.PlaybackStopped += PlaybackStopped; CurrentOut.Volume = _Volume; CurrentStream = stream; CurrentOut.Init(stream); StreamSource = null; } }
public void Dispose() { CurrentStream?.Dispose(); }
protected override void DisposeCode() { CurrentStream.Dispose(); }
/// <summary> /// Releases the underlying stream. /// </summary> public override void Dispose() { CurrentStream?.Dispose(); }
public void Dispose() { CurrentStream.Dispose(); CurrentChannel = null; }