Login

russian armor

SNF needs your help with autohotkey scripts

18 Jun 2014, 10:04 AM
#1
avatar of AmiPolizeiFunk
Admin Black Badge
Patrion 15

Posts: 16697 | Subs: 12

Hello fight fans. Do we have any .ahk masters here?

What I need: A script that will fade out the volume on WMP 12. I am on Windows 7 Pro.

This will help me do nice audio transitions between scenes when I stream on SNF. I need it to fade out the music from the intermission slide show to go into the intro movie, and then again to fade out the background music during the commentator intro when we go in-game. Any help would be hugely appreciated!

I found this potentially helpful thread: http://www.autohotkey.com/board/topic/21984-vista-audio-control-functions/

I'm pretty lost as to how to actually get it to work tho.

Here is my current .ahk script to control COH2 in windows mode (thx Twister):

Code
SetTitleMatchMode, 2
#IfWinActive, Company Of Heroes 2
^!z::
WinSet, Style, -0xC40000, a
WinMove, a, , 0, 0, % A_ScreenWidth, % A_ScreenHeight
return
^!a::
WinSet, Style, +0xC40000, a
WinMove, a, , 0, 0, % A_ScreenWidth, % A_ScreenHeight
return


18 Jun 2014, 10:10 AM
#2
avatar of m00nch1ld
Donator 11

Posts: 641 | Subs: 1

i use winamp and it has integrated things like this. very simple.

for wmp i recommend searching for plugin. im sure there are tons of that what you need.
18 Jun 2014, 10:34 AM
#3
avatar of morten1

Posts: 368

Wheres grease monkey NTD at?
18 Jun 2014, 11:37 AM
#4
avatar of Stafkeh
Patrion 14

Posts: 1006

I gave it a shot, but doesn't work at all :(

If there is a code for AutoHotKey to lower your volume it can't be that hard.
You can just use a loop to 0.

But I didn't find anything for lowering the volume..
18 Jun 2014, 12:03 PM
#5
avatar of m00nch1ld
Donator 11

Posts: 641 | Subs: 1

18 Jun 2014, 12:40 PM
#6
avatar of Stafkeh
Patrion 14

Posts: 1006

This should help
http://grok.lsu.edu/Article.aspx?articleId=12728


He is looking for a way to fade out the music at any time he want with a button.
This is just to fade it out on the end of the song and fade in on the begin of a song.

Goanna give it another try. I like coding <444>3

EDIT:
Code
#IfWinActive, Windows Media Player

::ControlSend,, {f9}, Windows Media Player

::ControlSend,, {f8}, Windows Media Player

I found this. Lowering the volume with F8, higher it with F9. Its not exacly what you want but its something. I'll keep searching.

EDIT:
After doing some more research.. Its not easy at all to make the music fade out. I found some AutoHoyKey programs for it but I don't understand them.. Guess I'll keep it to CoH2 codes :p
18 Jun 2014, 13:56 PM
#7
avatar of AmiPolizeiFunk
Admin Black Badge
Patrion 15

Posts: 16697 | Subs: 12

All I need is like you said, a button to fade the music down. I can raise the volume manually, that's no problem. But I would really like the fade out hotkey for various scene transitions!

WMP has a crossfade into next song, but that's not what I want. :| I'd like to stay with WMP if possible. I have a "hotkey add-on" for WMP that lets me start and stop songs with hotkeys like CTRL-ALT-HOME (start/stop) and CTRL-ALT-RIGHTARROW (next song). That's really great and I use it all the time. Just need a hotkey for FADE OUT :)
18 Jun 2014, 14:40 PM
#8
avatar of maskedmonkey2

Posts: 262

Code
#g::

; Controls

; Volume Down Fade 1
; Volume Up Fade 2
;

2::
DetectHiddenWindows,On
Loop 10
{
ControlSend, ahk_parent, ^{up}, iTunes ahk_class iTunes
PostMessage, 0x111, 32815, 0,, ahk_class WMPlayerApp
Sleep, 500

}
return

1::
DetectHiddenWindows,On
Loop 10
{
ControlSend, ahk_parent, ^{down}, iTunes ahk_class iTunes
PostMessage, 0x111, 32816, 0,, ahk_class WMPlayerApp
Sleep, 500

}
return


Just fyi, I have never used autohotkey before and have little to no programming experience.

I hobbled this together from various places on the interweb.

Beats working!

Edit: You might want to mess around with the sleep values to get the fade you want.

Also, apparently it works with itunes too.

You ought to be able to just paste it into your existing script at the end.
18 Jun 2014, 14:50 PM
#9
avatar of nigo
Senior Editor Badge

Posts: 2238 | Subs: 15

Ami,


did you tried Razor Synapse for change hotkeys/ new macros?

http://www.razerzone.com/synapse2
18 Jun 2014, 15:52 PM
#10
avatar of Stafkeh
Patrion 14

Posts: 1006

Wow, nice one there MaskedMonkey. I had an idea like that in my head. But I dont have a lot of experience with AHK.. Nicely done there ;)
18 Jun 2014, 19:01 PM
#11
avatar of AmiPolizeiFunk
Admin Black Badge
Patrion 15

Posts: 16697 | Subs: 12

Thanks maskedmonkey2! Gonna give it a try.
19 Jun 2014, 09:10 AM
#12
avatar of DanielD

Posts: 783 | Subs: 3

I think you have to give maskedmonkey a staff badge now.
20 Jun 2014, 09:27 AM
#13
avatar of AmiPolizeiFunk
Admin Black Badge
Patrion 15

Posts: 16697 | Subs: 12

Can't seem to get it to work by simply pasting it in, and don't really know how to test and debug. Can anybody make it work with WMP 12?
20 Jun 2014, 09:30 AM
#14
avatar of AmiPolizeiFunk
Admin Black Badge
Patrion 15

Posts: 16697 | Subs: 12

lol I'm such an idiot. The WMP keys plug-in that I'm already using has volume up and volume down :facepalm:

http://wmpkeys.sourceforge.net/

this just got alot easier :snfAmi:
20 Jun 2014, 09:48 AM
#15
avatar of AmiPolizeiFunk
Admin Black Badge
Patrion 15

Posts: 16697 | Subs: 12

Ok now that I learned a little more about ahk, I figured out why your script wasn't working for me. I pasted it at the bottom of my code, and basically it got borked because it was underneath
Code
#IfWinActive, Company Of Heroes 2

I pasted it at the top and it worked! So thx for that... I think I'll find a solution now.
20 Jun 2014, 10:04 AM
#16
avatar of AmiPolizeiFunk
Admin Black Badge
Patrion 15

Posts: 16697 | Subs: 12

Here's the final code:

Code

; note: "WMP Keys" software installed

; Ctrl-Alt-PageUp to go from 0 volume to 75
^!PgUp::
DetectHiddenWindows,On
Loop 15
{
Send ^!{Up}
Sleep, 250
}
return

; Ctrl-Alt-PageDown to go from 75 volume to 0
^!PgDn::
DetectHiddenWindows,On
Loop 15
{
Send ^!{Down}
Sleep, 250
}
return

; Ctrl-Alt-Insert to go from 0 volume to 20
^!Ins::
DetectHiddenWindows,On
Loop 4
{
Send ^!{Up}
Sleep, 250
}
return

SetTitleMatchMode, 2
#IfWinActive, Company Of Heroes 2

; Ctrl-Alt-z to put COH2 into fullscreen mode
^!z::
WinSet, Style, -0xC40000, a
WinMove, a, , 0, 0, % A_ScreenWidth, % A_ScreenHeight
return

; Ctrl-Alt-a to put COH2 back into windowed mode
^!a::
WinSet, Style, +0xC40000, a
WinMove, a, , 0, 0, % A_ScreenWidth, % A_ScreenHeight
return


Gonna try it out today! Wish me luck :)
1 user is browsing this thread: 1 guest

Livestreams

unknown 9
Germany 1081
Germany 1

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

319 users are online: 319 guests
1 post in the last 24h
8 posts in the last week
31 posts in the last month
Registered members: 50135
Welcome our newest member, Marab781
Most online: 2043 users on 29 Oct 2023, 01:04 AM