namespace MoonWorks.Audio { /// /// PersistentVoice should be used when you need to maintain a long-term reference to a source voice. /// public class PersistentVoice : SourceVoice, IPoolable { public PersistentVoice(AudioDevice device, Format format) : base(device, format) { } public static PersistentVoice Create(AudioDevice device, Format format) { return new PersistentVoice(device, format); } /// /// Adds an AudioBuffer to the voice queue. /// The voice processes and plays back the buffers in its queue in the order that they were submitted. /// /// The buffer to submit to the voice. /// Whether the voice should loop this buffer. public void Submit(AudioBuffer buffer, bool loop = false) { Submit(buffer.ToFAudioBuffer(loop)); } } }