 ;-------------------------------------------------------
 
 ;-------------------------------------------------------
+; Toggle main microphone mute
+; Here, 10 is the ID of my microphone.
+;-------------------------------------------------------
+ShowMicrophoneOSD(CustomText)	
+{
+    SetTimer, HideMicrophoneOSD, 500 ; Hide after specified delay
+    GuiControl, MicrophoneGui:Text, OSDMicrophoneTextValue, %CustomText% ; Set text
+    Gui, MicrophoneGui:Show, x1325 y900 NoActivate ; NoActivate avoids deactivating the currently active window.
+    return
+}
+
+HideMicrophoneOSD()
+{
+    Gui, MicrophoneGui:Hide,
+}
+
+Pause::
+    SoundSet, +1, MASTER, mute, 10
+    SoundGet, microphone_mute , , mute, 10
+    ; -Var := "Microphone MUTE is " . microphone_mute
+    if (microphone_mute = "ON")
+    {
+        showMicrophoneOSD("Microphone MUTED")
+    } else {
+        showMicrophoneOSD("Microphone ON AIR")
+    }
+    SetTimer, HideMicrophoneOSD, -2000
+return
+
+RemoveToolTip:
+    ToolTip
+return
+;-------------------------------------------------------
+
+;-------------------------------------------------------
 ; Adjust volume by scrolling the mouse wheel over the taskbar
 ;-------------------------------------------------------
 MouseIsOver(WinTitle) {

    return WinExist(WinTitle . " ahk_id " . Win)
}

ShowOSD(CustomText)	
{
	SetTimer, HideOSD, 500  ; Hide after specified delay
	GuiControl, Text, OSDTextValue, %CustomText%  ; Set text
	Gui, Show, xCenter y900 NoActivate  ; NoActivate avoids deactivating the currently active window.
	return
}

HideOSD()
{
	Gui, Hide,
}

#If (MouseIsOver("ahk_class Shell_TrayWnd") or MouseIsOver("ahk_class Shell_SecondaryTrayWnd"))
WheelUp::
	Send {Volume_Up}
	SoundGet, master_volume
	ShowOSD(Round(master_volume))
return
WheelDown::
	Send {Volume_Down}
	SoundGet, master_volume
	ShowOSD(Round(master_volume))
return
MButton::
	Send {Volume_Mute}
	Sleep, 100 
	SoundGet, Mute, Master, MUTE
	if (Mute = "ON")
	{
		ShowOSD("MUTE")
	} else {
		ShowOSD("UNMUTE")
	}
return
;-------------------------------------------------------


;-------------------------------------------------------
; OSD for volume
;-------------------------------------------------------
Gui, VolumeGui:New
Gui VolumeGui:+LastFound +AlwaysOnTop -Caption +ToolWindow ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, VolumeGui:Color, FFD54F ; Set background color
Gui, VolumeGui:Font, s32 w600, Arial ; Set a large font size (32-point).
Gui, VolumeGui:Font,, Ubuntu Condensed ; Preferred font.
Gui, VolumeGui:Add, Text, vOSDVolumeTextValue +Center, UNMUTE
;-------------------------------------------------------

;-------------------------------------------------------
; OSD for microphone
;-------------------------------------------------------
Gui, MicrophoneGui:New
Gui MicrophoneGui:+LastFound +AlwaysOnTop -Caption +ToolWindow ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, MicrophoneGui:Color, ef5350 ; Set background color
Gui, MicrophoneGui:Font, s32 w600, Arial ; Set a large font size (32-point).
Gui, MicrophoneGui:Font,, Ubuntu Condensed ; Preferred font.
Gui, MicrophoneGui:Add, Text, vOSDMicrophoneTextValue w500 +Center, Default text
;-------------------------------------------------------

;;*******************************************************
