Author Topic: Exception when loading my commands  (Read 1362 times)

0 Members and 1 Guest are viewing this topic.

Scitz0

  • Jr. Member
  • **
  • Posts: 11
  • Karma: 0
    • View Profile
Exception when loading my commands
« on: November 20, 2013, 12:14:17 PM »
Hi,

I am quite new to voxcommando but I have got most to work as I would like, controlling XBMC, Zoom Player, iTach, and different TCP devices.
Today I made several changes in the command editor but when saving and closing it threw an exception for one command tree(TCP Yamaha receiver) that I cant figure out the cause for.

If someone could point me in the right direction I would be very thankful.

Exception:
Code: [Select]
2013-11-20 16:11:58 249 Error creating grammar: Yamaha
2013-11-20 16:11:58 249 Error text: System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
   at System.IO.__Error.EndOfFile()
   at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
   at System.IO.BinaryReader.ReadUInt32()
   at System.Speech.Internal.SrgsCompiler.CfgGrammar.CfgSerializedHeader.IsCfg(Stream stream, Int32& cfgLength)
   at System.Speech.Recognition.SrgsGrammar.SrgsGrammarCompiler.CheckIfCfg(Stream stream, Int32& cfgLength)
   at System.Speech.Recognition.SrgsGrammar.SrgsGrammarCompiler.CompileXmlOrCopyCfg(Stream inputStream, Stream outputStream, Uri orginalUri)
   at System.Speech.Recognition.Grammar.LoadCfg(Boolean isImportedGrammar, Boolean stgInit)
   at System.Speech.Recognition.Grammar.LoadAndCompileCfgData(Boolean isImportedGrammar, Boolean stgInit)
   at System.Speech.Recognition.Grammar.InitialGrammarLoad(String ruleName, Object[] parameters, Boolean isImportedGrammar)
   at System.Speech.Recognition.Grammar..ctor(String path, String ruleName, Object[] parameters)
   at System.Speech.Recognition.Grammar..ctor(String path)
   at l.a(XmlElement A_0, Boolean A_1, String A_2, CommandList& A_3)
   at l.a(String A_0, SpeechRecognitionEngine A_1, CommandList& A_2, TreeView& A_3)

The commands for Yamaha group:
Code: [Select]
<commandGroup open="False" name="Yamaha" enabled="True" prefix="" priority="0" requiredProcess="" description="">
        <command id="489" name="Power on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Power ON}&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver power on</phrase>
        </command>
        <command id="490" name="Power off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Standby}&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver power off</phrase>
        </command>
        <command id="600" name="Volume set" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>Map.Set</cmdType>
                <cmdString>Receiver_Yamaha&amp;&amp;Current VOL&amp;&amp;{1}</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver set volume</phrase>
            <payloadRange>15-70</payloadRange>
        </command>
        <command id="535" name="Mute" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Mute}&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver</phrase>
            <phrase>mute, unmute</phrase>
        </command>
        <command id="536" name="Scene XBMC" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Scene 2}&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver scene</phrase>
            <phrase>x b m c, media center</phrase>
        </command>
        <command id="546" name="Scene TV" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Scene 3}&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver scene</phrase>
            <phrase>t v, television</phrase>
        </command>
        <command id="547" name="Scene Music" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Scene 4}&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver scene music</phrase>
        </command>
        <command id="548" name="Scene XBOX" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Scene 1}&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver scene x box</phrase>
        </command>
        <command id="581" name="Get current volume" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>Tcp.Client.Connect</cmdType>
                <cmdString>Receiver&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Tcp.Client.Write</cmdType>
                <cmdString>Receiver&amp;&amp;{M:Receiver_Yamaha.Get VOL}&amp;&amp;100</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TCP.Client.Disconnect</cmdType>
                <cmdString>Receiver</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>receiver current volume</phrase>
        </command>
        <command id="602" name="Silent mode" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Set VOL}70\x0D\x0A&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <event>SilentMode</event>
        </command>
        <command id="612" name="Normal mode" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>TCP.Single.Write</cmdType>
                <cmdString>{M:Receiver_Yamaha.Set VOL}{M:Receiver_Yamaha.Current VOL}\x0D\x0A&amp;&amp;192.168.0.4&amp;&amp;50000</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <event>NormalMode</event>
        </command>
    </commandGroup>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Exception when loading my commands
« Reply #1 on: November 20, 2013, 01:26:35 PM »
Hi Scitzo,

Welcome to VoxCommando.  I'm not 100% sure it will solve your problem, but your payload range has a typo in it.  The range is specified using a comma not a dash.

In your "volume set" command the payload range should be  15,70   not   15-70

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="617" name="Volume set" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Map.Set</cmdType>
    <cmdString>Receiver_Yamaha&amp;&amp;Current VOL&amp;&amp;{1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>receiver set volume</phrase>
  <payloadRange>15,70</payloadRange>
</command>

Scitz0

  • Jr. Member
  • **
  • Posts: 11
  • Karma: 0
    • View Profile
Re: Exception when loading my commands
« Reply #2 on: November 20, 2013, 04:46:39 PM »
That did it, thanks!