Instructables

Program or script to change volume...?

Another question that is way out of my league (woe is me). 

I need (or rather want) a program, in either Java or VBs (if there's a better one like Python or something, that would be alright too) to change the volume of a Windows computer. 

It would also be a good showcase of your skills to make it able to change the volume of a specific program or application. 

The way I intend to use it is as if it were a function, rather than a program. So a different script will activate it (perhaps by writing it, which in Java I don't think is possible) and then set the volume and the program to change the volume of. If that can't be achieved, could it be made to read a text file (or something else) with two lines on it; the first the program, the second the volume. If the first line says something like none, It would change the volume of the whole computer.

Hopefully I've given you a good enough description to make it clear exactly what to do. Thank you in advance.

g-one1 year ago
Prof. Pickle

As you already know I'm more familiar with C. So I wrote a small program for you in C and WinAPI. It's quick'n'dirty since it does nothing but emulating the multimedia keys on your keyboard.
Of course I attached the C source code as well. You can download "mmctrl.zip" here.
For additional information how it works check out
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
Prof. Pickle (author)  g-one1 year ago
Thank you very much. You'll be in the credits of a project me and someone else are currently working on.
Kirkthepyro13 days ago

it might be too late, but if you ever need a vbscript function, here it is:

set oShell = CreateObject("WScript.Shell")

oShell.run"%SystemRoot%\System32\SndVol.exe "'Runs The Master Volume App.
WScript.Sleep 1500 'Waits For The Program To Open
oShell.SendKeys("{PGUP}")'Turns Up The Volume 20, If It Is Muted Then It Will Unmute It
oShell.SendKeys("{PGUP}")'Turns Up The Volume 20
oShell.SendKeys("{PGUP}")'Turns Up The Volume 20
oShell.SendKeys("{PGUP}")'Turns Up The Volume 20
oShell.SendKeys("{PGUP}")'Turns Up The Volume 20
oShell.SendKeys"%{F4}"' ALT F4 To Exit The App.

frollard1 year ago
What operating system?

In windows 7, you can adjust master volume, as well as the individual volumes of any other programs separately. Clicking on the volume icon in the system tray (bottom right, looks like a speaker) should bring up the volume. Right click/playback should show all programs.
Prof. Pickle (author)  frollard1 year ago
Thanks, I guess. However, as my questions states, I want a program to do this automatically. Such as in a game you can change the game volume from within.
that's not automatic - you want something that assigns hotkeys to existing commands. Correct?
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!