After searching around on the forums and just googling for a while, I still can't figure out how to write a script to preform what I would like.
What I am trying to do: I want create a script that mutes my mic when it is started. I then want said script to allow my mic to be unmuted when a key is held down. When the key is released, I then want my mic to mute again. Basically, a push to talk key. I also, if possible, do not want my mic to instantly mute, I would like it to remain unmuted for like half a second after the key is released. It would put the icing on the cake if the script was also able to play a short and quiet noise when my mic was activated (so I would know people can hear me, kinda like discords push to talk system) and another quiet noise when the key is released.
After looking around and reading mainly old posts (I couldn't find anything very new, or friendly to new users who have little coding experience) I have this:
Code: Select all
k::
SoundSet, 0, MASTER, Mute, 7
KeyWait, k ;
SoundSet, 1, MASTER, Mute, 7
Return
Now, this is probably a lot to ask, but I figure you are the people to ask. If you are willing to help, please, keep in mind that I am pretty new to this. If you have tutorial suggestions, I am open to learning and not just getting free code (although I won't argue with you if you are willing to do that, with "that" being some code ).
To break it down, I want to try and get code to 1) Mute mic when script is launched 2) Have mic unmute while a key is held down 3) Have mic mute after key is released.
I figure this is a solid place to start. Is the code I have already almost right? Thank you in advance.