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

SHOUT IT OUT!

No ProfanityNumber of ShoutsRefresh Shout Box
Lady Xenarra: @Willy Pete The lack of April Fools this year is odd lol
Last Wednesday, 01:34 AM
Willy Pete: @Rosbone not dead yet. when that happens the font will switch to Papyrus :*(
Last Wednesday, 00:16 AM
dasheepeh: it was an honor guys :guyokay:
Last Tuesday, 20:34 PM
aerafield: yeah I already prepared my "Can't believe there's comic mode for the 10 daily visitors even on this April 1st" :guyokay:
Last Tuesday, 20:29 PM
Rosbone: @dasheepeh I guess that means this site is officially dead :guyokay:
Last Tuesday, 20:19 PM
dasheepeh: no comic sans font for april 1st this year?
Last Tuesday, 19:56 PM
Willy Pete: @Lady Xenarra this you? https://i.imgflip.com/3e4thi.jpg
Last Tuesday, 02:53 AM
Lady Xenarra: Does anyone else think that USF needs buffs? It feels like they’re on life support sometimes
Last Tuesday, 02:36 AM
Willy Pete: @Rosbone Ahh I missed that memo. I still think its a bad decision though. Adds frustration for players and isnt gonna make them that much money
27 Mar 2025, 15:46 PM
Rosbone: It is also good they left it free until after the free to play weekend. Points for that.
27 Mar 2025, 09:34 AM
Rosbone: But I agree, the cost to get a full decent Coh game pushing $115 US is not the best idea. Especially when it needs so much more work for casuals.
27 Mar 2025, 09:32 AM
Rosbone: To be fair, it was a thank you to early fans right? They said it was not free for long and it would become a pay DLC at some point.
27 Mar 2025, 09:30 AM
Willy Pete: Re-releasing free DLC so they can charge new players money for it. Brilliant marketing strategy :clap:
27 Mar 2025, 04:31 AM
Soheil: Coh2 still broken server ?
25 Mar 2025, 18:27 PM
Rosbone: Congrats to Relic. Looks like Coh3 has finally usurped Coh2 s the popular Coh. You smell terrific. :snfQuinn:.
24 Mar 2025, 02:46 AM
Nickbn: and again someone else replies. I mean come on guys. Give @adamírcz a chance
22 Mar 2025, 14:00 PM
Willy Pete: @Nickbn you didn't ask a question, and this is a chat box...
20 Mar 2025, 13:11 PM
Nickbn: @Rosbone it's incredibly rude to speak on someone elses behalf, especially when a question is directly adressed to them. I understand your passion for the subject at hand but I want to hear from him.
20 Mar 2025, 10:16 AM
Rosbone: @Nickbn No, I am just saying people should not be using any Relic owned forum since they have proven they ban anyone who says true things about Coh3.
18 Mar 2025, 19:01 PM

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

388 users are online: 1 member and 387 guests
sumclubvegas
1 post in the last 24h
12 posts in the last week
74 posts in the last month
Registered members: 53333
Welcome our newest member, sumclubvegas
Most online: 2043 users on 29 Oct 2023, 01:04 AM