Author Topic: VC volume setting in windows  (Read 4065 times)

0 Members and 1 Guest are viewing this topic.

philby85

  • $upporter
  • Jr. Member
  • *****
  • Posts: 19
  • Karma: 0
    • View Profile
VC volume setting in windows
« on: January 11, 2014, 01:24:24 AM »
Hi All,

Not sure if this is a windows thing or a setting that can be adjusted in VC. If i restart VC it will set itself to the highest volume that the speakers are set to. If I drag the slider down it will stay at what ever level I set until I restart VC again.
Is there a way to set the volume output of VC ?

kind regards

Phil

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: VC volume setting in windows
« Reply #1 on: January 11, 2014, 05:29:29 AM »
Hi philby85, I'm not sure what you mean with "volume output for VC"

You can adjust and save the volume for each output in the windows audio settings. If you mean only the TTS Voice volume, you can adjust this by an VC command - the action is called "TTS.SetVolume" which you can trigger when VC is loaded.

Here is a example Command group which set the TTS volume to 70% after VC is loaded:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="set TTS output level" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1384" name="TTS output level" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SetVolume</cmdType>
      <cmdString>70</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
</commandGroup>

I hope this will help you  ;)
***********  get excited and make things  **********

philby85

  • $upporter
  • Jr. Member
  • *****
  • Posts: 19
  • Karma: 0
    • View Profile
Re: VC volume setting in windows
« Reply #2 on: January 11, 2014, 07:08:39 PM »
Hi Kalle,

Thanks for your reply. I have attached a pic, showing the windows sound mixer after launching VC. It is at the volume of the speakers. I can drag the slider to where I want and it will stay. If I restart VC after making some adjustments the level will be back to where it is in the pic.


kind regards Phil

« Last Edit: January 11, 2014, 08:03:09 PM by jitterjames »

philby85

  • $upporter
  • Jr. Member
  • *****
  • Posts: 19
  • Karma: 0
    • View Profile
Re: VC volume setting in windows
« Reply #3 on: January 11, 2014, 07:30:33 PM »
Hi Kalle,

My apologies. Your command was exactly what I needed. Thank you. I hate being a newbie  :big laugh, but you have to start some where.

cheers

Phil

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: VC volume setting in windows
« Reply #4 on: January 11, 2014, 07:42:31 PM »
No problem, nice to hear that it works.  ;)
***********  get excited and make things  **********

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: VC volume setting in windows
« Reply #5 on: February 23, 2014, 10:48:05 PM »
What would be the best high level architecture to for a “Volume Normalize” feature that would allow not make Vox Commando  cause hearing damage if the system volume is at 100% (which some movies require)...but still allow it to be heard if  the volume is at 20%:

•         At < 30% System Volume – I need 100% Vox Commando volume

•         At 31% < 50% System Volume – I need 90% Vox Commando volume

•         At 51% < 70% System Volume – I need 80% Vox Commando volume

•         At 71% < 90% System Volume – I need 70% Vox Commando volume

•         At > 90% System Volume – I need 60% Vox Commando volume

In a perfect world, I could create an event each time the volume crossed the threshold...but that would assume the TTS.SetVolume will stay static until changed (i.e not per action).

Any ideas how to implement this in VOX Commando framework would be helpful.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: VC volume setting in windows
« Reply #6 on: February 24, 2014, 02:02:52 AM »
Hey AgileHumor and welcome to VC forum. I hope this command group is what you searching for - mark this whole code and drag it to your command tree.
How the code works: If VC switch to ON mode (a event "VC.On" is generated). Then the command check the current system master volume (by the action "Sound.GetVol") and the logic block (If/Then/Else) set the TTS volume to the value which you has descibed above. This will show you also how a LogicBlock in VC works - have fun  ;)

Kalle

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="TTS Volume Normalize" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="689" name="TTS Volume Normalize" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Sound.GetVol</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;30</ifParams>
      <then>
        <action>
          <cmdType>TTS.SetVolume</cmdType>
          <cmdString>100</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>TTS volume is set  to 100 percent</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50&amp;&amp;{LastResult}</ifParams>
      <then>
        <action>
          <cmdType>TTS.SetVolume</cmdType>
          <cmdString>90</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>TTS volume is set  to 90 percent</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70&amp;&amp;{LastResult}</ifParams>
      <then>
        <action>
          <cmdType>TTS.SetVolume</cmdType>
          <cmdString>80</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>TTS volume is set  to 80 percent</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90&amp;&amp;{LastResult}</ifParams>
      <then>
        <action>
          <cmdType>TTS.SetVolume</cmdType>
          <cmdString>70</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>TTS volume is set  to 70 percent</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>91 92 93 94 95 96 97 98 99 100&amp;&amp;{LastResult}</ifParams>
      <then>
        <action>
          <cmdType>TTS.SetVolume</cmdType>
          <cmdString>60</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>TTS volume is set  to 60 percent</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <event>VC.On</event>
  </command>
</commandGroup>
« Last Edit: February 24, 2014, 02:04:57 AM by Kalle »
***********  get excited and make things  **********

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: VC volume setting in windows
« Reply #7 on: February 24, 2014, 03:21:06 AM »
This is exactly what I'm looking for.  Thanks so much...you made my evening :)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC volume setting in windows
« Reply #8 on: February 24, 2014, 11:43:51 AM »
The real problem here is that you are using WMC.  I get that there are reasons for using it, but one of the many highly annoying things about it is that it won't let you set the volume for WMC without forcing the entire system audio volume to change.  What an arrogant decision the developers made there.  It boggles the mind.

Normally I would say that you should be leaving your system audio at 100% at all time, and then adjusting the volume of your movie separately so that it doesn't affect your TTS volume.

One solution which has other benefits is to send your TTS audio to a different audio output.  This is absolutely necessary if you are using direct audio streaming such as in DTS movies because then you won't be able to use TTS at all unless you use a different output.

It seems counter-intuitive to lower your TTS volume when your system audio is higher because the louder your media is, the louder your TTS would need to be for you to hear it!

OK, so assuming you have to do it this way for various reasons here is what I would suggest.

Kalle's solution is very clever and can be a good method for solving certain types of problems, but you are now asking VC to do an awful lot of work, every single time that you ask it to pay attention.  There are two things (or 3) that could be improved here.

0 - don't do this at all (see above)

1 - Find a better way to trigger this command so that it is not being done every time VC turns on. This will depend on you and how you are using it so I'm not sure what to suggest here exactly.  But ideally just call it whenever you set the system volume.)

2 - When you do run this command, don't make it do so much work.  A long sequence of (--if --(contains) --then --else) is not efficient.  Fine if it were the only way, or if it were a command that was only running once in a while...

So here is a way to do it more efficiently.  You will need to enable the python plugin but don't be scared by that.  We are only using it for a very simple math equation.

Here is the equation I'm using but you can tweak it to your liking:  TTSVOL = 100 - (SYSVOL/2)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="1105" name="tts inverse volume adjustment" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Sound.GetVol</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>result = 100-({LastResult}/2)</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SetVolume</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>VC.On</event>
</command>

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: VC volume setting in windows
« Reply #9 on: February 24, 2014, 01:33:01 PM »
WMC using the system volume has been a miserable experience.  Seems like they had some challenges with it in Vista and never engineered around the problem.  Very lame.

Since I use a HTPC to analog stereo output that goes to the whole home audio system...in theory adding another sound card should solve the problem and I can just have both sound cards feed the pre-amp input of the the Russound Home Audio amp.

So just to clarify, I would add an action to switch the VC sound card on the event of VC.On?  I don't see a way to do it in the settings.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC volume setting in windows
« Reply #10 on: February 24, 2014, 01:42:44 PM »
If you want to set the TTS sound output to another device you would use the action TTS.SetOutput

You can also set the default output device for TTS in windows settings: 
Go to Windows Text to Speech settings and then  click the "Advanced..." button.

If it is always going to be going to the same output, then you should use the VC.Loaded event.  Using the VC.On event should be avoided unless you really need to do something every time VC switches to On mode.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC volume setting in windows
« Reply #11 on: February 24, 2014, 01:44:36 PM »
Oh by the way,

In VoxCommando version 2 there will be a setting for the default TTS output device to use.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: VC volume setting in windows
« Reply #12 on: February 25, 2014, 03:28:28 AM »
So I decided to get a seconds sound card based on the feedback in this forum.

I'm going to try something like this USB sound card so I can terminate the audio paths correctly. 
http://www.amazon.com/gp/product/B000KW2YEI/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1

I've heard if I use a Y cable bad things may ensue.

I'm tempted to get a volume normalizer too, but then I can't seem to change the volume at the HTPC as it would always normalize it down.
http://www.amazon.com/CeeNee-advanced-Processor-performance-cancellation/dp/B008N4IB3S/ref=pd_cp_MI_0

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC volume setting in windows
« Reply #13 on: February 25, 2014, 08:43:04 AM »
In your situation it might make more sense to use VAC.

http://download.cnet.com/Virtual-Audio-Cable/3000-2168_4-10067766.html

Yeah, I would avoid using a y-cable, but then again you could always try it, and if the quality sounds OK to you then no worries.  I don't think it is dangerous or anything, but then I am no expert on this topic.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: VC volume setting in windows
« Reply #14 on: February 27, 2014, 06:31:51 PM »
I ended up using the Behringer UCA202 Audio Interface USB sound card and set my TTS settings in Advanced button for Windows Speech Recognition.  I use the output to feed my whole home audio system.  It also has an input, which I feed take in the audio. 

Using this trick, http://answers.microsoft.com/en-us/windows/forum/windows_7-pictures/is-it-possible-to-have-speakers-and-hdmi-play-at/4563a5f8-4be4-4463-b312-eff594a9ae49, i can mix the "Input USBB Audio" from the HTPC to my "Output USB Audio" which contains a mix of the TTS audio and the HTPC from the Audio. 

I output the TTS on that and it FINALLY HAVE A STANDARD TTS VOLUME  :biglaugh SO happy!  WAF greatly improved.

Now, I have something new to b$%)@ about :)
* Can Sound.PlayWav go to a specific soundcard (specifically, the one I'm using for TTS)?  Currrentlyit goes to the default sound device (which I use for WMC).
* Have Sound.PartialMute duck the default sound (which it does), but leave the TTS soundcard volume the same?   This is the current behavior, but the above change might affect this need.

This just might be an isolated request...so I understand if it can't/won't happen.

Thanks for the consideration.
« Last Edit: February 27, 2014, 06:52:21 PM by AgileHumor »