Author Topic: Reducing in game volume on assigned key press  (Read 3479 times)

hbuzz

  • Guest
Reducing in game volume on assigned key press
« on: December 03, 2017, 05:22:43 AM »
Hi there,

So I play sim racing games through a pair of speakers. I have voice attack to adjust some in game menus (like requesting pit stops, changing tyres etc) The problem I'm finding is that as I play through speakers VA is often having issues picking up my speech due to engine noise etc. What I would like ideally is my mapped key on press to reduce the in game volume to reduce and me to be able to give my command before the normal volume level resumes once i release the key press. My hope would be that because of the reduced game volume VA would interpret/acknowledge requests more accurately. Is this possible at all? If so how would I go about this?

Many thanks,

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Reducing in game volume on assigned key press
« Reply #1 on: December 03, 2017, 05:42:16 AM »
This will duck(reduce) the application volume as long as the key is held down:
Code: [Select]
Set application [{ACTIVEWINDOWTITLE}] audio volume offset to [-50]
Start Loop While : [{STATE_KEYSTATE:RCTRL}] Equals '1'
End Loop
Set application [{ACTIVEWINDOWTITLE}] audio volume offset to [50]

The "{ACTIVEWINDOWTITLE}" token will point to your game, provided it has focus, meaning VoiceAttack TTS/sound volume would be unaffected.

The key identifier for the "{STATE_KEYSTATE:}" token should match the key you assigned to trigger the command(A list of these can be found on page 141 of VoiceAttackHelp.pdf).
You can substitute the "{STATE_JOYSTICK1BUTTON:}" token if you'd rather use a button on a joystick/steering wheel(This assumes you have that device mapped as joystick 1 in VoiceAttack).

You'll want to play with the offset as well; 50 isn't a huge difference on my machine.

hbuzz

  • Guest
Re: Reducing in game volume on assigned key press
« Reply #2 on: December 03, 2017, 05:56:52 AM »
Wow thanks Pfeil,

This sounds exactly what I'm looking for. I'll familiarise myself with the .pdf and give it a go.

Many thanks!

hbuzz

  • Guest
Re: Reducing in game volume on assigned key press
« Reply #3 on: December 03, 2017, 09:14:04 AM »
Hello,

Apologies for my complete newbness! How do I actually go about inputting this? I presume it's something along the lines of New Command>When I press Button>Other - From this point I'm lost admittedly?

Thanks,

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Reducing in game volume on assigned key press
« Reply #4 on: December 03, 2017, 09:26:45 AM »
I've attached a .vap containing the command so you can import it.

Click , click "Import Commands", select the file from wherever your downloads are stored, click "Open", finally click "Import".


EDIT: Fixed image links
« Last Edit: June 12, 2018, 04:44:55 PM by Pfeil »

hbuzz

  • Guest
Re: Reducing in game volume on assigned key press
« Reply #5 on: December 03, 2017, 10:02:22 AM »
Thanks Pfeil,

It's working perfectly and just as desired after a little heads scratching. I've now used {STATE_JOYSTICK1BUTTON:4} and it's just as I wanted.

Many thanks for persevering with me!

Haydn

backon65

  • Guest
Re: Reducing in game volume on assigned key press
« Reply #6 on: June 12, 2018, 05:17:21 PM »
Thanks still working on VA to no my voice but put the confidence down to 20% and then it stated working cant wait to share it :D