Exemplo n.º 1
0
    public void EnableDevicesSimple()
    {
        try
        {
            WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicMute();
            micMute.UnMuteMic();
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.Message);
        }

        this.devcon.StartInfo.Arguments = "enable =Image";
        this.devcon.Start();
        while (!this.devcon.StandardOutput.EndOfStream)
        {
            string line = this.devcon.StandardOutput.ReadLine();
            Debug.WriteLine(line);
        }
        this.devcon.StartInfo.Arguments = "enable =MEDIA";
        this.devcon.Start();
        while (!this.devcon.StandardOutput.EndOfStream)
        {
            string line = this.devcon.StandardOutput.ReadLine();
            Debug.WriteLine(line);
        }
    }
Exemplo n.º 2
0
        private static void Main()
        {
            var micMute = new WindowsMicMute();

            if (micMute.IsMicMuted)
            {
                micMute.UnMuteMic();
            }
            else
            {
                micMute.MuteMic();
            }

            var micStatus = (micMute.IsMicMuted ? string.Empty : "un") + "muted";

            try
            {
                CueSettingsSdk(micMute.IsMicMuted);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
            }

            ToastNotification("Mic is " + micStatus, micStatus);
        }
Exemplo n.º 3
0
 private void UnMute()
 {
     if (muted)
     {
         muted = false;
         theMic.UnMuteMic();
         notifyIcon1.Icon = Properties.Resources.mic;
     }
 }
Exemplo n.º 4
0
    public void EnableDevices()
    {
        try
        {
            WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicMute();
            micMute.UnMuteMic();
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.Message);
        }

        List <string> keysToRemove = new List <string>();

        foreach (KeyValuePair <string, string> kvp in this.currentlyDisabledDeviceDictionary)
        {
            string uniqueID = this.GetUniqueID(kvp.Key);
            if (uniqueID.Length == 0)
            {
                throw new Exception("Unable to enable device, a unique id could not be found.");
            }
            this.devcon.StartInfo.Arguments = @"enable """ + uniqueID + @"""";
            this.devcon.Start();
            while (!this.devcon.StandardOutput.EndOfStream)
            {
                string line = this.devcon.StandardOutput.ReadLine();
                Debug.WriteLine(line);
                if (line.Contains(kvp.Key + ": Enabled"))
                {
                    Debug.WriteLine("The device has been renabled. " + uniqueID);
                    keysToRemove.Add(kvp.Key);
                }
                else
                {
                    Debug.WriteLine("Unable to enable device : " + uniqueID);
                }
            }
        }

        if (keysToRemove.Count > 0)
        {
            foreach (string k in keysToRemove)
            {
                this.currentlyDisabledDeviceDictionary.Remove(k);
            }
        }
    }
Exemplo n.º 5
0
 void speech_SpeakCompleted(object sender, SpeakCompletedEventArgs e)
 {
     mute.UnMuteMic();
 }