Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: papaschtroumpf on October 11, 2005, 05:17:54 pm

Title: command line volume adjust?
Post by: papaschtroumpf on October 11, 2005, 05:17:54 pm
I have been working at balancing sound levels in my cab, so that different games and different emulators, and the jukebox software, have roughly the same base volume.
I have a few PC games that don't have a volume adjust option (I think Demon Star is one of them).

Is there a command line utility that I could use to set the current master volume of your sound card to a particular level? I could then launch the PC game from a batch file that sets the volume lower before launching the game, then restores it. Ideally you would be able to query the initial volume so you don't have to hardcode anything.
Title: Re: command line volume adjust?
Post by: jcrouse on October 11, 2005, 08:02:23 pm
Slightly off topic but I have two button configured on my control panel to adjust the volume while in the Front-End, MameWAH, by using an AHK script that I wrote. I would guess you could edit the script and make it any two keys you like. That way you could use too "odd" keys (not used by the game) to adjust the volume while the game is playing. It may work. The script looks like so:

; This script assigns hotkeys of your choice to raise and lower the
; master volume.

;_________________________________________________
;________________Global Settings__________________

#NoTrayIcon
#SingleInstance force

;_________________________________________________
;________________User Settings____________________

; The percentage by which to raise or lower the volume each time:
vol_Step = 2

HotKey, m, vol_MasterUp
HotKey, n, vol_MasterDown

vol_MasterUp:
SoundSet, +%vol_Step%
return

vol_MasterDown:
SoundSet, -%vol_Step%
return



Good Luck,
John
Title: Re: command line volume adjust?
Post by: papaschtroumpf on October 11, 2005, 10:38:07 pm
I have a volume control of my cab (an actual knowb to the speakers) but I'm trying to make all games about the same level.
I nothing else I can use AHK to change the volume and exit wihtout actually waiting for a key, so you jsut gave me a way to write my own volume adjust. I had not thought about it.

I use to use AHK a lot when it used to be AutoIt, but kind of forgot about it, but it's becoming my cab's new best friend.
Title: Re: command line volume adjust?
Post by: pkellum on October 12, 2005, 02:58:02 am
Have you tried VolumeLine?  It seems to do exactly what you're asking, setting the volume of any sound channel.  I've tried it a bit and it seems to work fine.  And it's free, always a good thing :)

http://glorysoft.omsk.ru/vlt_download.html

Patrick
Title: Re: command line volume adjust?
Post by: BobbyG66 on November 07, 2005, 08:52:03 am
Slightly off topic but I have two button configured on my control panel to adjust the volume while in the Front-End, MameWAH, by using an AHK script that I wrote. I would guess you could edit the script and make it any two keys you like. That way you could use too "odd" keys (not used by the game) to adjust the volume while the game is playing. It may work. The script looks like so:

; This script assigns hotkeys of your choice to raise and lower the
; master volume.

;_________________________________________________
;________________Global Settings__________________

#NoTrayIcon
#SingleInstance force

;_________________________________________________
;________________User Settings____________________

; The percentage by which to raise or lower the volume each time:
vol_Step = 2

HotKey, m, vol_MasterUp
HotKey, n, vol_MasterDown

vol_MasterUp:
SoundSet, +%vol_Step%
return

vol_MasterDown:
SoundSet, -%vol_Step%
return



Good Luck,
John

John,

Do you have a command to MUTE?
Title: Re: command line volume adjust?
Post by: papaschtroumpf on November 07, 2005, 10:29:48 am
Look in the auohotkey help file, there is a mute command
Title: Re: command line volume adjust?
Post by: BobbyG66 on November 07, 2005, 11:14:43 am
Thanks, I am a former Autoit user.
Will check it out!
Title: Re: command line volume adjust?
Post by: headkaze on November 08, 2005, 12:18:09 am
Is there a command line utility that I could use to set the current master volume of your sound card to a particular level? I could then launch the PC game from a batch file that sets the volume lower before launching the game, then restores it. Ideally you would be able to query the initial volume so you don't have to hardcode anything.

I liked your idea so I wrote a little program to do that. It's written so you can launch before and after a game to store/restore volume settings. You run "volume -read" before the game to store current volume, launch the game and then manually set the volume the way you want, exit the game then run "volume -write" to write the game volume settings and restore volume back to original. Now when you run the game again it will set the volume to your manual setting.  I havn't properly tested it yet so if you have any problems, just post here.

It can also store/retrieve volumes for multiple games, just use the "-file <filename>" switch with both the -read and -write switches and it will read/write a volume dat file for that game.

You could use a batch file...

Code: [Select]
@echo off
volume.exe -read -file mygame.dat
mygame.exe
volume.exe -write -file mygame.dat

You only have to manually set the volume once during the game, then it will remember forever. You can always change it again during the game and it will store the new volume.

Volume v1.0 (http://members.iinet.net.au/~freeaxs/mame/volume.zip)