Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

can you please make this script for me: mute/unmute mic with F7


  • Please log in to reply
5 replies to this topic
Komix
  • Members
  • 3 posts
  • Last active: Jun 27 2014 10:21 AM
  • Joined: 17 May 2014

I want to start making let's play videos and such and it would be great if I could blow my nose without it being on there, haha



Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

>>can you please make this script for me: mute/unmute mic with F7

 

No.

 

1. you haven't told us how you would do this withusing the F7 hotkey,

2. you haven't told us what the program was, assuming we could figure it out after we got the name.

 

perhaps if you can provide this maybe someone can help.

 

3. the purpose of the forum is to help people learn to program with AHk, you just started

 

If you have not alread done so, please work through the tutorial.

http://www.autohotke...cs/Tutorial.htm



Komix
  • Members
  • 3 posts
  • Last active: Jun 27 2014 10:21 AM
  • Joined: 17 May 2014

I want to mute the mic for the entire system, by pressing F7 and unmute it again if I press F7 again. (it's all in the title really)

or if that's easier F8 to unmute

 

if this isn't where I can find the script I need then where is?

 

I know this program is going to be about 4 lines of code, and is heavily going to feature the line that sets the status of the mic, unfortunately I don't know what that is. Also an if/else and possible a variable, but if you could do it for me would be the fastest way for me to be helped



Jaff
  • Members
  • 14 posts
  • Last active: Aug 11 2014 12:23 AM
  • Joined: 04 Apr 2014

If you haven't gotten it in the last 3 days, here:

 

http://www.autohotke...ds/SoundSet.htm

 

I think what you want is :

;[Untested]

Muted = 0

f7::
if muted = 0
   {
   muted = 1
   SoundSet, 1, Microphone, mute
   }
else
   {
   muted = 0
SoundSet, 1, Microphone, On     ;  I assume this is the unmute command, I haven't tried it.
   }
return


Komix
  • Members
  • 3 posts
  • Last active: Jun 27 2014 10:21 AM
  • Joined: 17 May 2014

thanks

 

it says invalid parameter at this line: SoundSet, 1, Microphone, On 

 

but even with just the muting line it still seems to not do anything. I am not sure what could be wrong.



Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

Jaff's idea is good.

 

To make it work, do the following:

 

In a separate Ahk file, place this script, save and run it

 

Spoiler

 

 

Press F3 to open the sound/recording window (I also had to 2x click the "microphone entry" and then the "levels" tab)

On the levels page, look for a microphone level control, a value and a button

Confirm that the button toggles,

 

I don't expect it to work, but you can try the F5 hotkey to see if it toggles that same button.

If it does work, then you can test this with your final application

 

If not, continue here

 

======================================================================

 

Go to this web page and copy the script for "SOUNDCARD ANALYSIS" to an AHk file

http://www.autohotke...SoundSet.htm#Ex

 

Fyi, the script listing starts with

; SOUNDCARD ANALYSIS
 

it ends with

GuiClose:
ExitApp

 

Add this line to the top of the file and save it

#SingleInstance off

 

 

run this 2nd script and it will show a list of entries (I 2x click the script in my folder)

press the button in the levels window

run this 2nd script again

 

put the two windows with listing side by side and compare the entries

you should find one entry with a difference  in the "setting" column on / off

Note the text in these columns:   component type, control type, Mixer for me they were   Master, Mute, 3

 

Edit the first script to change the "soundset" command and replace the 3 parameters as needed.

 

Save the changes, close the running script and run it again.

watch the button in the levels window to see if it toggles.

 

If it does work, then you can test this with your final application

     you can close the 2nd running script (both copies)

     you can copy the F5 hotkey to a different script and change the hotkey as desired.

 

If it doesn't work, report back what you have tried, and your results.

  Please be detailed and methodical in your report.