private void GetAudioMeterInformation() { object result; deviceInterface.Activate(typeof(IAudioMeterInformation).GUID, ClsCtx.ALL, IntPtr.Zero, out result); audioMeterInformation = new AudioMeterInformation(result as IAudioMeterInformation); }
/// <summary> /// Constructor. /// </summary> /// <param name="audioSessionControl"></param> public AudioSessionControl(IAudioSessionControl audioSessionControl) { audioSessionControlInterface = audioSessionControl; audioSessionControlInterface2 = audioSessionControl as IAudioSessionControl2; var meters = audioSessionControlInterface as IAudioMeterInformation; var volume = audioSessionControlInterface as ISimpleAudioVolume; if (meters != null) { audioMeterInformation = new AudioMeterInformation(meters); } if (volume != null) { simpleAudioVolume = new SimpleAudioVolume(volume); } }