-
06-09-2009, 02:11 PM #1
Something that might be useful to Fraps + Microphone users.
I have been playing about with recording videos and my own voice in BF2142. The problem I have is that everything gets recorded not just what I want other people to hear, things like my own breathing or the kids in the background or me ranting because I have just been killed for the 10th time in a row. So I thought there has to be a way I can un-mute my microphone only when I hold down one of my voip keys and even more than that only un-mute when I am recording in game and press one of my voip keys.
So what I did was start messing about creating some scripts with AutoHotKey (I have this on my system because I used it in the past to create a sticky crouch key for BF2142). I created a script that when I press the key that starts recording in fraps (in my case the [ key) will also start the scripts that correspond to voip keys for BF2142 and Teamspeak, and then when I press the same key to stop recording the voip un-mute key scripts are then stopped. Now I am no autohotkey wiz so there may be better ways of doing this but this seems to work for me. I called my first script record-key.ahk this then starts 3 more scripts called key-01.ahk, key-02.ahk and key-03.ahk when the [ key is pressed for the first time and then kills the same 3 scripts when its pressed again. The key-0x.ahk scripts un-mute the microphone while the assigned key is held down then mute it again when the key is relesed.
This a commented record-key.ahk script
This is a commented key-01.ahk script$[::
; This script runs key press scripts that are used to un-mute and mute the microphone
keywait,[ ; Waits for the key that is assigned to start/stop recording in Fraps to be pushed and released
; Run the key press scripts one for each key used for voip i.e. Teamspeak, Sqaud voip, Commander voip
;run, full\path\of\scripts
run, D:\Scripts\key-01.ahk
run, D:\Scripts\key-02.ahk
run, D:\Scripts\key-03.ahk
keywait,[,D ; Waits for the key that is assigned to start/stop recording in Fraps to be pushed again
SetTitleMatchMode, 2 ; Use with the WinClose command
DetectHiddenWindows, On
; Kill the key press scripts now that recording is finished
; WinClose, scriptname ahk_class AutoHotkey
WinClose, key-01.ahk ahk_class AutoHotkey
WinClose, key-02.ahk ahk_class AutoHotkey
WinClose, key-03.ahk ahk_class AutoHotkey
DetectHiddenWindows, Off
; I added this as an after thought just in case you stop recording while still holding one of the voip keys
SoundSet,1 , MICROPHONE, MUTE
Return
Below are the real scripts I use.$v::
; This script toggles microphone mute when the V key is pressed and released
keywait,v,D ; Waits for key to be pressed down
SoundSet,0 , MICROPHONE, MUTE ; Un-mute the microphone
send {v down} ; Tell the OS that the key is pressed down
keywait,v ; Waits for key to be released
send {v up} ; Tell the OS that the key has been released
SoundSet,1 , MICROPHONE, MUTE ; Mute the microphone
Return
record-key.ahk
key-01.ahk$[::
keywait,[
;run, full\path\of\scripts
run, D:\Scripts\key-01.ahk
run, D:\Scripts\key-02.ahk
run, D:\Scripts\key-03.ahk
keywait,[,D
SetTitleMatchMode, 2
DetectHiddenWindows, On
;WinClose, scriptname ahk_class AutoHotkey
WinClose, key-01.ahk ahk_class AutoHotkey
WinClose, key-02.ahk ahk_class AutoHotkey
WinClose, key-03.ahk ahk_class AutoHotkey
DetectHiddenWindows, Off
SoundSet,1 , MICROPHONE, MUTE
return
key-02.ahk$n::
; This script toggles microphone mute when the N key is pressed
keywait,n,D
SoundSet,0 , MICROPHONE, MUTE
send {n down}
keywait,n
send {n up}
SoundSet,1 , MICROPHONE, MUTE
return
key-03.ahk$v::
; This script toggles microphone mute when the V key is pressed
keywait,v,D
SoundSet,0 , MICROPHONE, MUTE
send {v down}
keywait,v
send {v up}
SoundSet,1 , MICROPHONE, MUTE
return
So run the record-key.ahk and then fraps, but you can test it by just running the record-key.ahk on its own and pressing the [ key then talk while holding down V key, if its all working you should here yourself via your headphones. You can then press the [ key again and then hold down the V key should no longer un-mute/mute your microphone. Oh of course you need to have autohotkey installed on your pc for the scripts to work...$b::
; This script toggles microphone mute when the B key is pressed
keywait,b,D
SoundSet,0 , MICROPHONE, MUTE
send {b down}
keywait,b
send {b up}
SoundSet,1 , MICROPHONE, MUTE
return
-
06-09-2009, 07:02 PM #2
Re: Something that might be useful to Fraps + Microphone users.
interesting investigation there
link added to this thread from the 'video production' forum
http://www.tacticalgamer.com/video-p...ml#post1288717
-
06-09-2009, 07:27 PM #3
Re: Something that might be useful to Fraps + Microphone users.
Sorry I forgot to mention that I am using Windows XP...
-
06-09-2009, 08:39 PM #4
Re: Something that might be useful to Fraps + Microphone users.
wow thanks for this great tuts...
If you show your head then your dead....

-
06-10-2009, 01:08 PM #5
Re: Something that might be useful to Fraps + Microphone users.
Thanks guys I hope it is useful and of course if other people use the scripts they get a lot more testing than I can do on my own. I was re-reading your ‘Recording all sounds (you + squad + game effects)’ thread Silver specifically the ‘alt-tab & un-mute’ bit and this can be done with a script so that you don’t have to risk the alt-tab crashing your game. So you could bind a script to any key lets use the # key for this demo and have that key un-mute the microphone or even mute the microphone again at a second push of the key.
un-mute_mic.ahk
un-mute&mute_mic.ahk$#::
keywait,#
SoundSet,0 , MICROPHONE, MUTE
return
One other thing the key used may not get read by other programs when a script is bound to it, what I mean by that is if the script above is running and I am typing in notepad the # would not display. To get around this you just add to the script that the key has been pressed e.g. ‘send {#}’$#::
keywait,#
SoundSet,0 , MICROPHONE, MUTE
keywait,#,D
SoundSet,1 , MICROPHONE, MUTE
return
In some of the other scripts you will see that the send sometimes uses ‘down’ and ‘up’ e.g. ‘send {# down}’ or ‘send {# up}’ with down the script tells the OS that the key is being held down and up tells the OS that the key has been released.$#::
keywait,#
send {#}
SoundSet,0 , MICROPHONE, MUTE
keywait,#,D
send {#}
SoundSet,1 , MICROPHONE, MUTE
Return
I now feel like I have written much to much but let me just say one more thing… Silver, Kebab, Lyramion and all you other prolific TG movie makers keep up the good work, your videos are fun, inspirational and educational and I love watching them.
p.s. {Underpants} – {?} – {Profit}
-
06-10-2009, 02:47 PM #6
Re: Something that might be useful to Fraps + Microphone users.
Hi yet again just an update to my original post, the scripts in the original post work with Fraps on my PC but the first script record-key.ahk has problems with WeGame and Xfire Video. The problem is that the key used to activate these 2 programs (in my case the [ key) is interupted by the script binding to the key. Below is an updated version for the record-key.ahk that should work with WeGame and Xfire (well it does for me) but don't use this new one for Fraps..
record-key.ahk
$[::
keywait,[
send {[ down}
send {[ up}
; only use this version for Wegame and Xfire recording
; This script toggles microphone mute
run, D:\Scripts\key-01.ahk
run, D:\Scripts\key-02.ahk
run, D:\Scripts\key-03.ahk
keywait,[,D
send {[ down}
send {[ up}
DetectHiddenWindows, On
;WinClose, full\path\of\script ahk_class AutoHotkey
WinClose, D:\Scripts\key-01.ahk ahk_class AutoHotkey
WinClose, D:\Scripts\key-02.ahk ahk_class AutoHotkey
WinClose, D:\Scripts\key-03.ahk ahk_class AutoHotkey
DetectHiddenWindows, Off
SoundSet,1 , MICROPHONE, MUTE
return
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)



Reply With Quote



Bookmarks