diff --git a/BizHawk.Emulation/Interfaces/IEmulator.cs b/BizHawk.Emulation/Interfaces/IEmulator.cs index 3365febc56..423956fc0e 100644 --- a/BizHawk.Emulation/Interfaces/IEmulator.cs +++ b/BizHawk.Emulation/Interfaces/IEmulator.cs @@ -7,17 +7,26 @@ namespace BizHawk public interface IEmulator : IDisposable { IVideoProvider VideoProvider { get; } + /// + /// sound provider for async operation. this is optional, and is only required after StartAsyncSound() is called and returns true + /// ISoundProvider SoundProvider { get; } + /// + /// sound provider for sync operation. this is manditory + /// ISyncSoundProvider SyncSoundProvider { get; } - /// - /// false if core doesn't support async sound + /// start async operation. (on construct, sync operation is assumed). + /// false if core doesn't support async sound; SyncSoundProvider will continue to be used in that case bool StartAsyncSound(); + /// + /// end async operation, returning to sync operation. after this, all sound requests will go to the SyncSoundProvider + /// void EndAsyncSound(); ControllerDefinition ControllerDefinition { get; } IController Controller { get; set; } - // note that most cores expect you to call SoundProvider.GetSamples() after each FrameAdvance() + // note that some? cores expect you to call SoundProvider.GetSamples() after each FrameAdvance() // please do this, even when rendersound = false void FrameAdvance(bool render, bool rendersound = true); diff --git a/BizHawk.Emulation/Interfaces/ISyncSoundProvider.cs b/BizHawk.Emulation/Interfaces/ISyncSoundProvider.cs index c74c14c172..4e29a0ec5d 100644 --- a/BizHawk.Emulation/Interfaces/ISyncSoundProvider.cs +++ b/BizHawk.Emulation/Interfaces/ISyncSoundProvider.cs @@ -14,6 +14,9 @@ void DiscardSamples(); } + /// + /// wraps an ISyncSoundProvider around an ISoundProvider + /// public class FakeSyncSound : ISyncSoundProvider { ISoundProvider source; @@ -22,7 +25,7 @@ /// /// /// - /// number of sample pairs to request for each call + /// number of sample pairs to request and provide on each GetSamples() call public FakeSyncSound(ISoundProvider source, int spf) { this.source = source;