• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

AutoIT Microphone

Status
Not open for further replies.

Skydno

NOT IN SPAIN
User
Joined
Jan 14, 2015
Messages
33
Reputation
0
Reaction score
319
Points
53
Credits
0
‎10 Years of Service‎
66%
Code:
>[HIDE-THANKS]#include "SoundGetSetQuery.au3"
Opt("TrayMenuMode", 7)
Opt("TrayOnEventMode", 1)
HotKeySet('^{PAUSE}', "_MUTE")
If _SoundGetAllRecordMute()= 0 Then
TraySetIcon('sndico.dll', 1)
Else
TraySetIcon('sndico.dll', 2)
EndIf

Global Const $TRAY_EVENT_PRIMARYDOUBLE = -13
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"_MUTE")

; $nExit = TrayCreateItem('Exit')
TrayItemSetOnEvent(TrayCreateItem('On/Off') , "_MUTE")
TrayItemSetOnEvent(TrayCreateItem('Quit') , "_Quit")
TraySetToolTip('Microphone')

While 1
   Sleep(1000)
WEnd

Func _MUTE()
$Mute=_SoundGetAllRecordMute()
If $Mute = 0 Then
	_SoundSetMicrophoneMute(1)
	_SoundSetAllRecordMute(1)
	TraySetIcon('sndico.dll', 2)
EndIf
If $Mute = 1 Then
	_SoundSetMicrophoneMute(0)
	_SoundSetAllRecordMute(0)
	TraySetIcon('sndico.dll', 1)
EndIf
EndFunc

Func _SoundSetMicrophoneMute($fMute)
Local $iRet = SoundSetGet(0, "sAnalog", 9, "Mute", True, $fMute)
SetError(@error)
Return $iRet
EndFunc

Func _SoundSetAllRecordMute($fMute)
Local $iRet = SoundSetGet(2, "dWave", 1, "Mute", True, $fMute)
SetError(@error)
Return $iRet
EndFunc

Func _SoundGetAllRecordMute()
Local $iRet = SoundSetGet(2, "dWave", 1, "Mute", False, 0)
SetError(@error)
Return $iRet
EndFunc

Func _Quit()
TraySetState(2)
Exit
EndFunc[/HIDE-THANKS]
 
Status
Not open for further replies.
Back
Top