public AudioDevice(string guid) { this.device = new CoreAudioController().GetDevice(Guid.Parse(guid)); this.muteObserver = new MuteObserver(this); this.muteObserver.Subscribe(this.device.MuteChanged); this.lastAction = DateTime.Now; }
/* * Creates controls for WindowsAudioDevice with GUID * guid: GUID of the WindowsAudioDevice to control */ public AudioDevice(string guid) { this.device = new CoreAudioController().GetDevice(Guid.Parse(guid)); if (this.device == null) { throw new Exception("Disconnected Audio-device in OBS-Settings. Exiting..."); } this.muteObserver = new MuteObserver(this); this.muteObserver.Subscribe(this.device.MuteChanged); this.mute = this.IsMuted(); }