public void ShutdownRevival() { CurrentStream.Load(savedSamplesPlayed); savedSamplesPlayed = 0; if (CurrentChannel != null) { CurrentChannel.ReapplySettings(); } }
public void ShutdownRevival() { if (savedSourceVoiceState == null) // nothing to resume here { return; } if (savedSourceVoiceState.Done) { CurrentSourceVoice = null; StopSourceVoice(StopReason.Ended); // WARNING: This may not work as intended (glanced over, but not tested) return; } var format = CurrentChannel.Sound.Format; NormalSourceVoice sourceVoice = new NormalSourceVoice(system, format); CurrentSourceVoice = sourceVoices[format] = sourceVoice; sourceVoice.SetupBuffer(CurrentChannel.Sound, CurrentChannel.Looping, (int)savedSourceVoiceState.SamplesPlayed); CurrentChannel.ReapplySettings(); savedSourceVoiceState = null; }