Author Topic: Options - Sounds for Recognized  (Read 1709 times)

0 Members and 1 Guest are viewing this topic.

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Options - Sounds for Recognized
« on: January 26, 2015, 06:47:29 AM »
I was wondering if it is possible to modify the "Options -> Sounds -> Recognized"

To something like:
If the command/event do's NOT have TTS.Speak or TTSMS.Speak (or other similar command) then play the sound set in "Options -> Sounds -> Recognized"

Do you know what I mean? Or maybe I am setting up my commands the wrong way?
« Last Edit: January 26, 2015, 06:59:54 AM by tn42 »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Options - Sounds for Recognized
« Reply #1 on: January 26, 2015, 08:50:16 AM »
You can't do it.

If you want to add sounds to specific commands, there are actions for that.

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: Options - Sounds for Recognized
« Reply #2 on: January 26, 2015, 08:53:49 AM »
Okey

Then I have to manually add Sound.playstream() to every command that don't have TTS or TTSMS in it?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Options - Sounds for Recognized
« Reply #3 on: January 26, 2015, 09:05:45 AM »
If I understand your goals as described above, then yes.  Instead I would recommend using a short innocuous sound for all recognised commands, like a gentle chime or bell sound or something like what the enterprise computer does when you address it or when you click your comm badge.

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: Options - Sounds for Recognized
« Reply #4 on: January 26, 2015, 10:04:46 AM »
Yes, in fact I am using the Voyager computer sound ;)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Options - Sounds for Recognized
« Reply #5 on: January 26, 2015, 10:50:24 AM »
If it's very important to you, there is a way for you to do this. It requires some special dance moves though.  :P

There is a short Python script that can generate an event each time a command is recognized -- discussed here: http://voxcommando.com/forum/index.php?topic=1689.msg14686#msg14686

That script can be customized. In the version attached here, the script only generates a "VC.Reco" event if the recognized command does NOT include the text "TTS" (in capital letters) in its command name.

So, if you are willing to add the label "TTS" somewhere in the command names of all commands that have TTS in them, you can then simply create a single, VC.Reco event-triggered command that plays the sound you want when there is no TTS. This is used instead of using the general setting in Options.

Here is a group of commands to give a concrete example of how you could implement this:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.6-->
<commandGroup open="True" name="Ignore TTS commands" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="460" name="What time is it TTS" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>It is {ShortTime}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>It is {ShortTime}.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>What time is it</phrase>
  </command>
  <command id="488" name="TTS-What day is it today?" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>It is {DtCustom.dddd - MMMM d}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>It is {DtCustom.dddd - MMMM d}.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>What day is it today?</phrase>
  </command>
  <command id="453" name="Launch website (no text to speech here)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Launch.OpenURL</cmdType>
      <params>
        <param>http://voxcommando.com/home/support/</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Launch website</phrase>
  </command>
  <command id="513" name="Command recognized sound" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Just a demonstration. Here you can do whatever you want to do.">
    <action>
      <cmdType>Sound.PlayWav</cmdType>
      <params>
        <param>special_song.wav</param>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Recognized command: {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Reco</event>
  </command>
  <command id="490" name="Load command recognized python script" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecFile</cmdType>
      <params>
        <param>PY\recognizedCmd.py</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
</commandGroup>

The adapted Python script, called RecognizedCmd.py, is attached. It should be saved to the PY folder in your VC directory (or change the file path in the command ""Load command recognized python script").

---
* Of course, you can change the script to a different condition if it's easier to label the commands that do not include TTS.
« Last Edit: January 26, 2015, 10:54:04 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: Options - Sounds for Recognized
« Reply #6 on: January 27, 2015, 06:45:13 AM »
I Think that it is just easyer to "remember" to put the sound.playstream() in every command that dos not have TTS in it.