Beispiel #1
0
        private void GetAudioMeterInformation()
        {
            object result;

            Marshal.ThrowExceptionForHR(deviceInterface.Activate(ref IID_IAudioMeterInformation, 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);
        }
        /// <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);
            }
        }
Beispiel #4
0
 private void GetAudioMeterInformation()
 {
     object result;
     Marshal.ThrowExceptionForHR(deviceInterface.Activate(ref IID_IAudioMeterInformation, ClsCtx.ALL, IntPtr.Zero, out result));
     audioMeterInformation = new AudioMeterInformation(result as IAudioMeterInformation);
 }