public SoundManager(IAudioContext context, IFactory factory) { _context = context; _factory = factory; _context.Create(); _listener = _factory.Create <IListener>(); }
/// <summary> /// Initializes the audio context with the specified configuration. /// </summary> /// <param name="config">Config.</param> public static void Initialize(AudioConfig config) { if (instance != null) { throw new InvalidOperationException("Only one audio context can be instantiated."); } instance = new AudioContext(config); }
private bool disposedValue = false; // To detect redundant calls private void dispose(bool disposing) { if (disposedValue) { return; } if (disposing) { // Dispose managed state (managed objects). } ctx?.Dispose(); disposedValue = true; instance = null; }
public static void InitializeForTest() { instance = new FakeAudioContext(); }
protected AudioService() { ctx = AudioContext.Instance; config = ctx.Config; }