|
|
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/sh...4&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/sh...0&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/sh...0&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 :/
Last edited by GM; 11-06-2009 at 04:42 PM.
Nice. I'd love this for songbird, cause winamp really reaks for managing huge libraries.
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.
Last edited by GM; 11-05-2009 at 03:59 AM.
Very Good Idea and Nice Work. +1
When the fog bitesWhen the creeps stingWhen I'm playing badI simply remember my favorite thingsAnd then I don't feel so bad
Thanks.
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?
Last edited by GM; 11-05-2009 at 08:36 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.
I use Winamp, thank you for this.
Move to Applications.
I might check this out some time![]()
I'm an honest guy who's not afraid to be blunt. Hope you can handle that.
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.
Thanks.
Last edited by GM; 11-05-2009 at 10:43 AM.
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.
Code:#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); } }
Last edited by GM; 11-10-2009 at 07:00 AM.
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:Examples:Code:WINKEY @ SHIFT + CTRL ^ ALT %
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
Last edited by GM; 11-06-2009 at 07:16 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!)
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.
Foobar also supports global hotkeys afaik.
So bind something in foobar to mute/unmute and use the hotkey plugin.
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.