News:

HOT TIP! Exploring the commands packaged in VC's standard configurations is a great way to learn how to build your own. You can also clone a command as a starting point: just right-click and select "Clone" (or type Alt-C).

Main Menu

VC read alternates aloud

Started by Kalle, October 15, 2013, 09:03:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kalle

Hi to all, I post here a command group that read the alternates (which VC has created) aloud.

important: you must set the check mark Generate VC.Alternates event in VoxCommando "Options Menu" - General tab

This posted command group use the payload "xbmcArtist.xml" which is for XBMC, but you can use any other payload (e.g. xbmcSongs.xml, iTunesArtist.xml and so on), but don't forget to change the phrase if you use other things like songs, album ...
and also the (A)Contains(B) in the logic block (play music). I use a logic block in this command to execute it only when the phrase contains the words "play" or "music". Otherwise VC read alternates from any command aloud.
Thanks to James, he figured out this easy way  ::bow

<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="play music or artist (read alternates aloud)" enabled="True" prefix="" priority="0" requiredProcess="" description="">
 <command id="417" name="play music by {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
   <action>
     <cmdType>OSD.ShowText</cmdType>
     <cmdString>{PF.1}</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <phrase>play</phrase>
   <phrase>artist, music by</phrase>
   <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcArtists.xml</payloadFromXML>
 </command>
 <command id="1163" name="alternates event" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
   <if ifBlockDisabled="False" ifNot="False">
     <ifType>(A)Contains(B)</ifType>
     <ifParams>{1}&amp;&amp;play music</ifParams>
     <then>
       <action>
         <cmdType>Results.SetLastResult</cmdType>
         <cmdString>There are {#P} alternates available. You can choose from option 1, to option {#P}.</cmdString>
         <cmdRepeat>1</cmdRepeat>
       </action>
       <action>
         <cmdType>Results.SetLastResult</cmdType>
         <cmdString>{LastResult}{CR}Option {i}: {{i}}.</cmdString>
         <cmdRepeat>{#P}</cmdRepeat>
       </action>
       <action>
         <cmdType>Results.RegExReplace</cmdType>
         <cmdString>play.*?\{|}</cmdString>
         <cmdRepeat>1</cmdRepeat>
       </action>
       <action>
         <cmdType>OSD.ShowText</cmdType>
         <cmdString>{LastResult}</cmdString>
         <cmdRepeat>1</cmdRepeat>
       </action>
       <action>
         <cmdType>TTS.SpeakSync</cmdType>
         <cmdString>{LastResult}</cmdString>
         <cmdRepeat>1</cmdRepeat>
       </action>
     </then>
     <else />
   </if>
   <event>VC.Alternates.*</event>
 </command>
</commandGroup>
***********  get excited and make things  **********

Kalle

#1
You can modify in this group the command "alternates event" which allow you how many alternates  VC are read (sometimes it is annoying when VC read 10 alternates).

this command read the first 3 alternates (replace the alternates event with this command)
or
to change the number of alternates by your self - replace the repeat "3" with any other number which make sense.

<?xml version="1.0" encoding="utf-16"?>
<command id="1163" name="alternates event (read the first 3 alternates)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
 <if ifBlockDisabled="False" ifNot="False">
   <ifType>(A)Contains(B)</ifType>
   <ifParams>{1}&amp;&amp;play music</ifParams>
   <then>
     <action>
       <cmdType>Results.SetLastResult</cmdType>
       <cmdString>There are {#P} alternates available. You can choose from option 1, to option {#P}. Here the first 3 alternates.</cmdString>
       <cmdRepeat>1</cmdRepeat>
     </action>
     <action>
       <cmdType>Results.SetLastResult</cmdType>
       <cmdString>{LastResult}{CR}Option {i}: {{i}}.</cmdString>
       <cmdRepeat>3</cmdRepeat>
     </action>
     <action>
       <cmdType>Results.RegExReplace</cmdType>
       <cmdString>play.*?\{|}</cmdString>
       <cmdRepeat>1</cmdRepeat>
     </action>
     <action>
       <cmdType>OSD.ShowText</cmdType>
       <cmdString>{LastResult}</cmdString>
       <cmdRepeat>1</cmdRepeat>
     </action>
     <action>
       <cmdType>TTS.SpeakSync</cmdType>
       <cmdString>{LastResult}</cmdString>
       <cmdRepeat>1</cmdRepeat>
     </action>
   </then>
   <else />
 </if>
 <event>VC.Alternates.*</event>
</command>
***********  get excited and make things  **********

jitterjames

Is this the same code block twice now, or is one different?

Kalle

the first code in this threat is a command group and the second code is only a command from the group but with changes.
***********  get excited and make things  **********

jitterjames