PDA

View Full Version : HoNVolumeControl - Lowers volume of your music player when someone uses HoN voicechat



GM8
11-04-2009, 08:19 PM
Introduction:
So, HoN has a nifty feature that lowers the sound of the effects when someone talks ingame.
Unfortunately, many of us listen to music outside the game.

Solution:
This program lowers the sound in your music player when someone on your team (including yourself) talk on HoN.
This prevents:
1) You yelling in your mic because of high background sound level
2) Others yelling at you for not paying attention

Supported players:
Natively:
Winamp
AIMP
Via hotkeys:
Any player with global hotkey support. For instructions refer to http://forums.heroesofnewerth.com/showpost.php?p=543894&postcount=12
If you need any help, please post in the thread.

Usage:
1) Open the inifile and set the correct player handler and volume multiplier. The defaults are Winamp and 0.1.
2) Start HoN, alttab
3) Start the program and leave it running.
4) Play some music in your player.
Refer to this post for other player support: http://forums.heroesofnewerth.com/showpost.php?p=539230&postcount=11

Notes:
1) It is important that the two first steps are done in sequence. Winamp can be already open etc...
2) If you restart HoN, you need to restart the program.
3) If S2 release a big patch, changing a lot of functionality about voice, this will probably break.
4) If you need the program to work with <insert player here>, try to code it yourself please, the API is provided.
5) If you are scared of exe files, then download Visual Studio Express and compile the source yourself.
6) Windows only.

Developers:
You can write your own plugins for controlling other players.
Please refer to this post: http://forums.heroesofnewerth.com/showpost.php?p=539230&postcount=11

Download:
http://gm.mainframe.no/stuff/HVC1.0.0.3.zip
Source code included, public domain.

Credit:
V10 from heroesofnewerth.ru for helping me find the function controlling sound in k2.dll and implementing the AIMP and hotkey plugins.

P.S.
S2, make accessing "talking/not talking" state a bit easier please :/

MaxGhost
11-04-2009, 08:40 PM
Nice. I'd love this for songbird, cause winamp really reaks for managing huge libraries.

GM8
11-05-2009, 03:36 AM
It's pretty much a matter of writing some simple code.
The hard part is extracting the status from HoN, not controlling the player...

That said, I don't see how to control songbird remotely.

DrRisan
11-05-2009, 06:44 AM
Could you make one for Spotify?

Guni
11-05-2009, 06:47 AM
Very Good Idea and Nice Work. +1

GM8
11-05-2009, 08:05 AM
Very Good Idea and Nice Work. +1
Thanks.


Could you make one for Spotify?
I think I need to make a plugin system, so people can code their own DLL's to control players.
There is no way I can code support for every available player.
Many players don't have an option to control volume remotely also, so you need to scan memory, find the volume control.... etc...

Also, I'm curious. Did anyone actually look at the source code and saw what I did there?

Syr1
11-05-2009, 08:47 AM
Taking Mumble as an example, it has the option to use the WSAPI to reduce the volume of all other applications while someone is speaking (with a very brief fade in.out so it doesnt sound bad), in practice it works very well and has no noticable performance side effects. I think it would be best to take a similar approach, however this functionality should be included in the HoN client anyway.

REDALiCE
11-05-2009, 09:03 AM
I use Winamp, thank you for this.

Warchamp7
11-05-2009, 09:06 AM
Move to Applications.

I might check this out some time :)

GM8
11-05-2009, 09:59 AM
Taking Mumble as an example, it has the option to use the WSAPI to reduce the volume of all other applications while someone is speaking (with a very brief fade in.out so it doesnt sound bad), in practice it works very well and has no noticable performance side effects. I think it would be best to take a similar approach, however this functionality should be included in the HoN client anyway.
There are a few problems with this, which you do not seem to acknowledge.
You mean WASAPI right?
Since WASAPI bypasses the Windows mixer, the way Mumble probably does it, is use WASAPI itself and modify all other streams.
A such approach can NOT be used here because:
1) WASAPI is available in Vista and up. Not available in XP.
2) HoN does not use WASAPI, why? Because sound in HoN works under XP and I honestly doubt they bothered making special functionality for Vista.

So, as good as it sounds, due to windows sound api sucking hard until recently, what you say is not feasible in the current scenario.

Move to Applications.

I might check this out some time :)
Thanks.

GM8
11-05-2009, 04:22 PM
OK, so what I did is allowed people to write their own plugins for this.
The updated version is in the OP.

For users:
1) Get plugin of your choice.
2) Put it in the same directory as the program
3) Set PlayerControlDLL in the .ini file to the plugin of your choice, default is libwinamp.dll

For developers:
The .ini allows you to specify the DLL that will be called when lowering or increasing the volume.

The DLL called must export two C style functions:
void IncreaseVolume(); - called when volume should be increased
void DecreaseVolume(double multiplier); - called when the volume should be decreased

If you need an example (or to copypaste code), check libwinamp.cpp.

#include <Windows.h>

EXTERN_C __declspec(dllexport) void IncreaseVolume();
EXTERN_C __declspec(dllexport) void DecreaseVolume(double multiplier);

int curvolume;

BOOL WINAPI DllMain(HINSTANCE dllInstance, DWORD reason, void* reserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;

case DLL_PROCESS_DETACH:
IncreaseVolume();
break;
}

return TRUE;
}

__declspec(dllexport) void IncreaseVolume() {
if (curvolume != NULL) {
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
if (hwndWinamp != NULL) {
SendMessage(hwndWinamp, WM_USER, curvolume, 122);
}
}
}

__declspec(dllexport) void DecreaseVolume(double multiplier) {
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
if (hwndWinamp != NULL) {
curvolume = SendMessage(hwndWinamp, WM_USER, -666, 122);
SendMessage(hwndWinamp, WM_USER, curvolume*multiplier, 122);
}
}

GM8
11-06-2009, 04:39 PM
Updated again.

Major changes are:
Support for AIMP
Support for any players supporting global hotkey

To use global hotkeys:
1) Set up your player (or use it's built in functions) to mute and unmute on certain hotkeys.
2) Configure the hotkey plugin.

Configuring the hotkey plugin:
In the HonVolumeControl.ini file is a separate section alled HotKey.
There you can set the hot key combination that gets executed when someone talks and when someone stop stalking.
They key modifiers are as follows:
WINKEY @
SHIFT +
CTRL ^
ALT %Examples:
Ctrl+Alt+A = ^%{A}
SHIFT+N = +{N}
Ctrl+Alt+Insert = ^%{INS}

Just set those hotkeys in your player and you are golden.
For more information, and the key list read: http://msdn.microsoft.com/en-us/library/aa266279(VS.60).aspx (http://msdn.microsoft.com/en-us/library/aa266279%28VS.60%29.aspx)

Notausgang
11-06-2009, 07:58 PM
I've been using Visual Basic's SendKeys a lot and it seems it bypasses most (if not all) global hotkeys and actually delivers the keystrokes to the active application.
I don't know how well you've tested it, but for me e.g. SendKeys.SendWait("^%{PGDN}") (which is "next track" on my Winamp) actually does not trigger Winamp.
(I have not had time to take a look at the app itself, but it sounds promising!)

GM8
11-07-2009, 06:44 AM
I've been using Visual Basic's SendKeys a lot and it seems it bypasses most (if not all) global hotkeys and actually delivers the keystrokes to the active application.
I don't know how well you've tested it, but for me e.g. SendKeys.SendWait("^%{PGDN}") (which is "next track" on my Winamp) actually does not trigger Winamp.
(I have not had time to take a look at the app itself, but it sounds promising!)
Hi, if you look at the source code then you will realize that this is not using VB.
A copypasted function is used, to allow defining keys in VB format, but that is the only common thing. The entire program is written in C++ and ASM.
Thus in this case, it sends keys globally.

Notausgang
11-07-2009, 08:47 AM
Cool, then nevermind :)

Ov3rMInD
11-09-2009, 04:23 AM
could u make one for foobar?

Syr1
11-09-2009, 07:33 AM
could u make one for foobar?

Foobar has plugins to emulate the winamp API, if the author is unwilling - have a look there.

GM8
11-09-2009, 11:33 AM
Foobar also supports global hotkeys afaik.
So bind something in foobar to mute/unmute and use the hotkey plugin.

Mandos1
11-10-2009, 02:56 AM
Good job man, always nice to see someone taking time to do apps like these. Won't have any use for the app. But will definately look through the source code.

GM8
11-10-2009, 07:01 AM
Good job man, always nice to see someone taking time to do apps like these. Won't have any use for the app. But will definately look through the source code.
It's not very pretty, but it gets the job done.

knallfrosch
11-15-2009, 06:42 AM
Could it be that win7 has this built in for the wmp+ventrilo combo?
Just asking people who might know.

GM8
11-15-2009, 01:59 PM
Could it be that win7 has this built in for the wmp+ventrilo combo?
Just asking people who might know.
Might be.

DoubleFine
11-21-2009, 07:19 AM
Is it possible to make this work with Itunes?

MaxGhost
11-21-2009, 09:49 AM
Is it possible to make this work with Itunes?

iTunes doesn't have global hotkeys, so I'm not sure.

Xasz
11-21-2009, 10:22 AM
This is quite possibly the most awesome thing ever. Thank you. =]

GM8
11-21-2009, 01:41 PM
Is it possible to make this work with Itunes?
It is, if you can get me the itunes SDK.
I am not going to pay apple 100$ for it.

Mike_ox_long
11-23-2009, 07:06 PM
Itunes please?

-edit-

Didn't go onto second page, didn't see people already asking for it :P

GM8
11-24-2009, 04:00 AM
Mmh...
Does iTunes have no global hotkey support?

It could be possible to bind "play" and "pause" buttons I guess...

Sagat
11-24-2009, 10:49 AM
Is it possible to make this work with Itunes?
Why the hell would you want to use iTunes?

Itunes please?

-edit-

Didn't go onto second page, didn't see people already asking for it :P
Switch player instead.

Mike_ox_long
11-24-2009, 10:51 AM
Why the hell would you want to use iTunes?

Switch player instead.

How? Just drag the music into the other player?

MaxGhost
11-24-2009, 04:02 PM
How? Just drag the music into the other player?

He's trolling you.

GM8
11-24-2009, 04:57 PM
But honestly, i'll make an itunes plugin. Just tell me what I have to write to itunes memory or what windows message I have to send...

I am just too lazy to reverse itunes atm heh...

MaxGhost
11-24-2009, 05:07 PM
http://code.google.com/p/itunes-control/

Does that help?

Mike_ox_long
11-24-2009, 06:28 PM
I wasn't trolling, I've never used AIMP before. But I figured it out and got everything transferred.

MaxGhost
11-24-2009, 06:31 PM
I wasn't trolling, I've never used AIMP before. But I figured it out and got everything transferred.

... Read my post again. I was saying the person you answered to was trolling you.

Mike_ox_long
11-24-2009, 06:34 PM
depends on how you read it.. I thought you were talking to OP and saying I was trolling him..

GM8
11-25-2009, 02:43 PM
http://code.google.com/p/itunes-control/

Does that help?
Cool.

Yea it does!

Delfofthebla
11-25-2009, 03:31 PM
Wondering how effective this will be. Love the concept though, I can't count how many times I've had to pause my music and go "Sorry, what was that?".

GM8
11-25-2009, 03:58 PM
Wondering how effective this will be. Love the concept though, I can't count how many times I've had to pause my music and go "Sorry, what was that?".
What do you mean "how effective this will be"?

Just download the application, run it, it works. It's not a "concept" it's realized and working.

Mike_ox_long
11-26-2009, 01:37 PM
What do you mean "how effective this will be"?

Just download the application, run it, it works. It's not a "concept" it's realized and working.

Yeah, I agreeskiz.

BTW I have noo idea how to run this thing using AIMP, even though I really want it to work :P

GM8
11-26-2009, 02:56 PM
What is the problem?

Mike_ox_long
11-26-2009, 04:37 PM
Well with the code..

[Main]
VolumeMultiplier = 0.1
PlayerControlDLL = libWinAmp.dll
//PlayerControlDLL = libAIMP.dll
//PlayerControlDLL = libHotKey.dll

[HotKey]
//Works only if libHotKey.dll set as control library
//Please visit to http://www.codeproject.com/KB/cpp/sendkeys_cpp_Article.aspx
// and http://msdn.microsoft.com/en-us/library/aa266279(VS.60).aspx for documentation about use hot keys.
//default set to
// Talking hot key Ctrl+Alt+Home (pause winamp)
// NotTalking hot key Ctrl+Alt+Insert (play winamp)

TalkingHotKey=^%{HOME}
NotTalkingHotKey=^%{INS}

What parts do I change to make it run off of AIMP? Can you change what needs to be changed and bold it please? :D Also what should the multiplier be?

Also, the hotkey part.. how do I set libHotkey.dll as the control library?

And the hotkeys like I thought that it should quiet down when I hit T to talk, and then quiet down automatically when someone else talks to me.. how do I do this?

:P

GM8
11-27-2009, 05:15 AM
Uncomment the libaimp.dll and comment the winamp.dll.
Comments are marked with "//"

Sorry, but I don't see what is hard about it.
Also, the control libraries are made for different players. libAIMP is for AIMP, libWinamp is for Winamp. libHotkey is a generic library which sends global hotkeys. It works with many different players.

However, if you are using AIMP, you do not need the hotkey library, as you have the AIMP library, which will work better.
You don't need to bind anything in game, you can use whatever keybinding you like ingame to talk. This program hooks into the HoN client and looks when someone starts talking... (either you or someone else). It is not dependent on any keys.

Battousii
11-27-2009, 10:17 AM
can you make this support itunes?

Mike_ox_long
11-27-2009, 12:14 PM
Got it to work, thanks.

And maybe it wouldn't be so hard to know that if you actually wrote in the instructions how to comment or uncomments things.

There is nothing in there as far as I've read

GM8
11-28-2009, 10:28 AM
Got it to work, thanks.

And maybe it wouldn't be so hard to know that if you actually wrote in the instructions how to comment or uncomments things.

There is nothing in there as far as I've read
It is considered common knowledge... Perhaps I should indeed take into account the fact that not everyone is familiar with the fact, that "//" or ";" is considered a comment.

I'll make a new, easier version in the future with a GUI...
Thanks for the feedback, and I am glad that you got it to work.

Mike_ox_long
11-28-2009, 11:15 AM
Aha I had no idea :O
But okay, thanks :D

LateGame
12-05-2009, 11:29 PM
no itunes?

Orava1
12-06-2009, 05:28 AM
What about rhythmbox etc? Probably most used audio server is pulseaudio. Would be nice to have HoNVolumeControl in linux.

``420fuck69`
12-15-2009, 08:02 AM
This looks awesome. Looking forward to a possible iTunes plugin. Thanks for all the hard work GM.

EnFeRm0
12-18-2009, 04:49 PM
A question, can you do this program but about all window ? I listen music by Youtube, Spotify, and other program, and I cant use this.

Sorry for my English, I"m Spanish.

ihopeuchoken
12-23-2009, 04:38 PM
When I listen to music, its usually pandora radio (pandora.com)
Think you can adapt this app for Pandora?
<3

Delfofthebla
12-26-2009, 12:27 AM
gentlemen gentlemen, itunesforgays, haven't you heard?

Winamp is great, and this program is great. Both are must haves!

Simuu
12-26-2009, 05:26 AM
gentlemen gentlemen, itunesforgays, haven't you heard?

Winamp is great, and this program is great. Both are must haves!

Well, I don't think that Winamp is great. In my opinion, Winamp is a slow and heavy player. I prefer foobar2000 :)

MaxGhost
12-26-2009, 11:59 AM
Winamp is epiccrap for making music libraries and organizing it. And it has extremely terrible support for iPods, not to mention it doesn't support iPhone/iTouch apps. iTunes is clean and simple and isn't in my way when I use it.

And now that I'm done my minirant, to each their own I guess.

Ilfirin
12-27-2009, 05:52 PM
ok, I cant get this to work, I dunno what Im doing wrong. I unpacked the zip file to my desktop, ran hon, alt+tabbed, started the program (the box opens and closes though, I don't believe it's staying open/running), then started my winamp, and it doesnt seem to do anything. Any help?

Delfofthebla
12-27-2009, 09:21 PM
Winamp is epiccrap for making music libraries and organizing it. And it has extremely terrible support for iPods, not to mention it doesn't support iPhone/iTouch apps. iTunes is clean and simple and isn't in my way when I use it.

And now that I'm done my minirant, to each their own I guess.

hmm, I can't say I've ever had ANY problems organizing my libraries, or configuring my ipod. When was the last time you used it? o.0

That said, I do think it's a "heavier" music player, as noted by Simuu. The main appeal to me of winamp is the global hotkeys, and I wouldn't use it if it didn't have them.

Simuu
12-28-2009, 05:14 AM
hmm, I can't say I've ever had ANY problems organizing my libraries, or configuring my ipod. When was the last time you used it? o.0

That said, I do think it's a "heavier" music player, as noted by Simuu. The main appeal to me of winamp is the global hotkeys, and I wouldn't use it if it didn't have them.

You should really take a look at foobar ( has global hotkeys :P ). It's maybe a bit work to configure it like you want it, but it's really worth it.

Sagat
12-28-2009, 03:48 PM
no itunes?

This looks awesome. Looking forward to a possible iTunes plugin. Thanks for all the hard work GM.
Or, you could stop using iTunes.

``420fuck69`
12-28-2009, 10:44 PM
^ see:


Winamp is epiccrap for making music libraries and organizing it. And it has extremely terrible support for iPods, not to mention it doesn't support iPhone/iTouch apps. iTunes is clean and simple and isn't in my way when I use it.

And now that I'm done my minirant, to each their own I guess.

Ilfirin
12-29-2009, 09:09 AM
Do I have to place the unpacked files into the HoN directory?

Delfofthebla
12-30-2009, 10:15 PM
Do I have to place the unpacked files into the HoN directory?

No, just run it from wherever after HoN is open.

EnFeRm0
01-01-2010, 03:03 PM
I renember my question, Is it posible do this app for the ALL Window Program?

realloaded
01-06-2010, 11:27 AM
Doens't work for me any more since I have my new Win7 Notebook :/
Before it did... (was XP)
I just get:
ERROR: Cann't get K2 module base.
=(
can anyone help me?

//Edit nvm this post, doesnt matter any more.

Practicer
01-09-2010, 11:40 AM
Allright, so I downloaded "winamp", transfered songs, and a whole bunch of other stuff and set up winamp the way I liked it. Then I downloaded the "HVC1.0.0.3" folder. Unziped the folder. Started HoN. Oppened the folder, clicked "HoNVolumeControl", clicked "run"... and I get a message saying "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

I can't figure it out and it's driveing me crazy! I try'ed redownloading it and that didn't work. I've spent literally houres trying to figure this out and I just don't know what else to do :( I know it's probebly just some stupid mistake that I'm makeing.

Can you please help me?

Thankyou
Practicer :fors:

GM8
01-12-2010, 11:13 AM
This hasn't been updated in a while, that might be it...
Got other projects for now though...

BuCk_ChOi
01-13-2010, 05:26 AM
please update if you have time! much appreciated

Delfofthebla
01-13-2010, 05:44 PM
Allright, so I downloaded "winamp", transfered songs, and a whole bunch of other stuff and set up winamp the way I liked it. Then I downloaded the "HVC1.0.0.3" folder. Unziped the folder. Started HoN. Oppened the folder, clicked "HoNVolumeControl", clicked "run"... and I get a message saying "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

I can't figure it out and it's driveing me crazy! I try'ed redownloading it and that didn't work. I've spent literally houres trying to figure this out and I just don't know what else to do :( I know it's probebly just some stupid mistake that I'm makeing.

Can you please help me?

Thankyou
Practicer :fors:

It still works just fine for me. Dunno how you're getting that error, seeing as how you don't install anything.

Did you make sure to edit the HoNVolumeControl.ini file?

BuCk_ChOi
01-15-2010, 06:49 PM
mine doesnt work also. things i done
1.downloaded this app.
2.uninstalled winamp.
3.downloaded new winamp
4.install winamp
5.drag playlist into winamp
6.turn on hon
7.turn on winamp
8.run app
9.start music
10.join game, game starts , tell some one to talk on mic, music still stays the same. using the default ini. file.

do i need to install any extra plugins when i install winamp from scratch?
Thanks

wyshywashy
01-16-2010, 03:36 AM
Does this app work for Itunes?

GM8
01-16-2010, 10:11 AM
I don't really have time right now to fix this app.
The source code is provided, if anyone wants to try.

It's not going to happen though, unless you are decent with C++ and good with ASM.

Ivarzone
02-16-2010, 04:14 PM
Spotify needs one for sure

Siska
03-02-2010, 07:25 PM
Can this be done for ventrilo as well?

CptJesus
03-03-2010, 03:39 PM
Can this be done for ventrilo as well?

Google preVentrilo. I think thats what you're looking for.

Siska
03-03-2010, 04:50 PM
Google preVentrilo. I think thats what you're looking for.

Yeah, i went googling after i posted, and found that.. thanks tho

SLeePz
03-05-2010, 06:02 PM
so all i need to do is

1)start hon
2)alt tab
3)start HVC app

then thats it? i didnt mess with the ini file cause i couldnt find it cause you said winamp is defualt and is which what im using

F8
04-27-2010, 06:44 PM
AIMP, a player which I've never heard of, has support. iTunes, the most well-known music player in the world, does not.

Makes sense.

realloaded
04-28-2010, 05:01 AM
Doesnt work anymore anyway

Delfofthebla
05-20-2010, 11:02 PM
Doesnt work anymore anyway
Yes it does lol.

Does iTunes have global hotkeys? If not, that is the reason. The program uses global hotkeys in order to pause/reduce volume.

Runeknight95
07-15-2010, 02:19 AM
Any one get it working for Itunes?

Seems reading through no it doesn't. Oh well I jumped for joy whe I read the title to the post and now i am sad again.

Emin3m
10-31-2010, 08:35 AM
does it work with Window Media Player ? i got hotkwy on my keyboard when it do not lower sound auto when i talk :/... this is very usefullll

Zephyr
07-29-2011, 07:52 PM
Bump incase anything has been updated

Vitamin_C
10-13-2011, 01:51 PM
Is it still working? Is it compatible with mumble? (Mumble reduce my winamp volume, too)

Winwolf
03-20-2012, 09:57 PM
How do i make this work? sorry i dont know how to do it. I got AIMP Player