namespace BizHawk { public interface ISyncSoundProvider { /// /// /// /// /// number of sample PAIRS available void GetSamples(out short[] samples, out int nsamp); /// /// /// void DiscardSamples(); } /// /// wraps an ISyncSoundProvider around an ISoundProvider /// public class FakeSyncSound : ISyncSoundProvider { ISoundProvider source; int spf; /// /// /// /// /// number of sample pairs to request and provide on each GetSamples() call public FakeSyncSound(ISoundProvider source, int spf) { this.source = source; this.spf = spf; } public void GetSamples(out short[] samples, out int nsamp) { short[] ret = new short[spf * 2]; source.GetSamples(ret); samples = ret; nsamp = spf; } public void DiscardSamples() { source.DiscardSamples(); } } }