Ejemplo n.º 1
0
        /// <summary>
        /// Returns the mute state of the microphone.
        /// </summary>
        /// <param name="isMuted">The mute state of the microphone.</param>
        /// <returns>
        /// MLResult.Result will be <c>MLResult.Code.Ok</c> if successful.
        /// MLResult.Result will be <c>MLResult.Code.UnspecifiedFailure</c> if failed due to internal error.
        /// MLResult.Result will be <c>MLResult.Code.InvalidParam</c> if a parameter is invalid.
        /// MLResult.Result will be <c>MLResult.Code.PrivilegeDenied</c> if <c>AudioCaptureMic</c> privilege is denied.
        /// MLResult.Result will be <c>MLResult.Code.AudioNotImplemented</c> if the function is not implemented.
        /// </returns>
        private MLResult.Code GetMicrophoneMuted(out bool isMuted)
        {
            MLResult.Code result;

            try
            {
                result = NativeBindings.MLAudioIsMicMuted(out isMuted);
                if (result != MLResult.Code.Ok)
                {
                    MLPluginLog.ErrorFormat("MLAudio.GetMicrophoneMuted failed to get the value. Reason: {0}", result);
                }
            }
            catch (System.DllNotFoundException)
            {
                // Exception is caught in the Singleton BaseStart().
                throw;
            }

            return(result);
        }