namespace MoonWorks.Audio { /// /// TransientVoice is intended for playing one-off sound effects that don't have a long term reference. /// It will be automatically returned to the source voice pool once it is done playing back. /// public class TransientVoice : SourceVoice, IPoolable { static TransientVoice IPoolable.Create(AudioDevice device, Format format) { return new TransientVoice(device, format); } public TransientVoice(AudioDevice device, Format format) : base(device, format) { } public override void Update() { lock (StateLock) { if (PlaybackInitiated && BuffersQueued == 0) { Return(); } } } } }