Author Topic: Error with using 2 of the same payload.xml in a command  (Read 3074 times)

0 Members and 1 Guest are viewing this topic.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Error with using 2 of the same payload.xml in a command
« on: August 07, 2015, 08:04:14 PM »
I'm trying to make my own "Cinema Experience" with VC as CE doesn't work all the time for me, but when I go to make the "Double Feature" Command I get these two errors when I close and save the command editor


Quote
---------------------------

---------------------------
Error opening group srgs file: srgs\en-US_Theater Experience.cfg

System.FormatException: '' rule reference not defined in this grammar.

   at System.Speech.Recognition.SrgsGrammar.SrgsRuleRef.Validate(SrgsGrammar grammar)

   at System.Speech.Recognition.SrgsGrammar.SrgsElement.Validate(SrgsGrammar grammar)

   at System.Speech.Recognition.SrgsGrammar.SrgsElement.Validate(SrgsGrammar grammar)

   at System.Speech.Recognition.SrgsGrammar.SrgsRule.Validate(SrgsGrammar grammar)

   at System.Speech.Recognition.SrgsGrammar.SrgsGrammar.Validate()

   at System.Speech.Recognition.SrgsGrammar.SrgsGrammar.System.Speech.Internal.SrgsParser.IElement.PostParse(IElement parent)

   at System.Speech.Recognition.GrammarBuilder.InternalGrammarBuilder.CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)

   at System.Speech.Recognition.GrammarBuilder.CreateGrammar(IElementFactory elementFactory)

   at System.Speech.Recognition.SrgsGrammar.SrgsDocument..ctor(GrammarBuilder builder)

   at eval_᜖.eval_ᜀ(GrammarBuilder A_0, String A_1)
---------------------------
OK   
---------------------------

And then this one after clicking "OK"

Quote
---------------------------

---------------------------
Failed to create cfg: srgs\en-US_Theater Experience.cfg
---------------------------
OK   
---------------------------

they seem to only happen when I use two of the same payload.xml

Double Feature
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.7-->
<command id="772" name="Double Feature" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Clear</param>
      <param>"playlistid": 1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>preparing Movies {PF.1} and {PF.2} for your movie theater experiance, Please place all cell phones on silent, and Enjoy the Double Feature</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Clear</param>
      <param>"playlistid": 1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item": {"file":"smb:\\Main-xbmc\3tb\(EXTRAS\cinema exp\Intro\Intro ({Rnd.1.5}).mp4"}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Clear</param>
      <param>"playlistid": 1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"smb:\\Main-xbmc\3tb\(EXTRAS\cinema exp\Refreshments\Refreshments ({Rnd.1.2}).mp4" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>https://www.youtube.com/user/movieclipsTRAILERS/videos</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>data-context-item-id="(.*?)"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"plugin://plugin.video.youtube/play/?video_id={Match.{Rnd.1.5}.1}" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"plugin://plugin.video.youtube/play/?video_id={Match.{Rnd.6.10}.1}" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"plugin://plugin.video.youtube/play/?video_id={Match.{Rnd.11.15}.1}" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"plugin://plugin.video.youtube/play/?video_id={Match.{Rnd.16.20}.1}" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"smb:\\Main-xbmc\3tb\(EXTRAS\cinema exp\Featured Presentation\FP ({Rnd.1.4}).mp4" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"smb:\\Main-xbmc\3tb\(EXTRAS\cinema exp\Shorts\Shorts ({Rnd.1.4}).mp4" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"movieid": {1} }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"smb:\\Main-xbmc\3tb\(EXTRAS\cinema exp\Intermission\Intermission.mp4" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"movieid": {2} }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Play Double Feature </phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcMovieIDs.xml</payloadFromXML>
  <phrase>and</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcMovieIDs.xml</payloadFromXML>
</command>

I wasn't sure if this is a bug with VC or Windows its self

It looks like the same problem as here http://voxcommando.com/forum/index.php?topic=2250.msg19537#msg19537
using VC 2.2.0.7 Windows 7
« Last Edit: August 07, 2015, 08:28:23 PM by PegLegTV »

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Error with using 2 of the same payload.xml in a command
« Reply #1 on: August 07, 2015, 08:31:09 PM »
Note: I replaced the command with the right one

When I made the post I was trouble shooting the problem and forgot to change the payload back,

the first one was using two different payloads, sorry for the confusion

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Error with using 2 of the same payload.xml in a command
« Reply #2 on: August 07, 2015, 09:03:34 PM »
This is Microsoft's fault.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Error with using 2 of the same payload.xml in a command
« Reply #3 on: August 07, 2015, 09:17:54 PM »
Okay,  ::saddest

do you know if there is a simple way around it, the only thing I can think of is to have the plugin (xJson or xMYSql) generate a copy of the payload something like xbmcMovies.xml and xbmcMovies2.xml

after some more testing I can't figure out how to add to a playlist with a movie ID so I'll have to use xbmcMovies.xml instead of xbmcMoviesIDs.xml

Thanks for the fast reply

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Error with using 2 of the same payload.xml in a command
« Reply #4 on: August 07, 2015, 10:12:15 PM »
It probably works if you have a smaller number of movies in your XML file.  Under normal circumstances, moving a command into its own group can solve similar problems but for the case where you are trying to use the same payloads twice in a single commands this might not make any difference.  Another option might be to turn off subset matching.  Creating two payloads with different names but the same contents won't make any difference.

The only solution other than to reduce the size of your payloads XML file would be to create a command that uses only one reference to the payloads XML instead of two.  It's a bit more work but you could create a command where you add movies to a list that is stored in a variable and then another command to actually play the list.

So you could say "Add movie {1} to playlist.  And say this as many times as you want, and then have another command to play it.  Relatively easy I think and you could probably come up with some flexible phrasing to make it more natural.  In a way it's better but you can't say it all in one single command.

Believe me I've tried everything I can think of to get the stupid SAPI engine to accept this type of command with large payloads, and if ever I think I've managed it, then something else breaks.  Since this is a bit of an unusual case, I'd rather this be broken if most other combinations are working properly.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Error with using 2 of the same payload.xml in a command
« Reply #5 on: August 07, 2015, 10:24:51 PM »
after some more testing I can't figure out how to add to a playlist with a movie ID so I'll have to use xbmcMovies.xml instead of xbmcMoviesIDs.xml

I think what you originally posted should work fine with the movie IDs, if you can find a way to work around the Microsoft bug.

In the command you posted, the only thing that seemed to be missing was an action to then play the playlist after everything is queued.

This trimmed down version of your command is working great for me:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.7-->
<command id="772" name="Double Feature" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Clear</param>
      <param>"playlistid": 1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <params>
      <param>preparing Movies {PF.1} and {PF.2} for your movie theater experience, Please place all cell phones on silent, and Enjoy the Double Feature</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>https://www.youtube.com/user/movieclipsTRAILERS/videos</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>data-context-item-id="(.*?)"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"file":"plugin://plugin.video.youtube/play/?video_id={Match.{Rnd.1.5}.1}" }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"movieid": {1} }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 1, "item": {"movieid": {2} }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item": { "playlistid": 1 }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Play Double Feature </phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcMovieIDs.xml</payloadFromXML>
  <phrase>and</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcMovieIDs.xml</payloadFromXML>
</command>

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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Error with using 2 of the same payload.xml in a command
« Reply #6 on: August 07, 2015, 10:33:34 PM »
P.S. I have a little over 100 movies in my movies payloadXML, and am not running into the bug, so as James says, if you can create a special, pared down version of your movies for this particular command that may be all that's needed.

e.g., the movieview table has a "date added" column, so you could create a special query that only populates the payload XML with the 100 most recently added movies, for example, into a special double_feature.xml file.
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)

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Error with using 2 of the same payload.xml in a command
« Reply #7 on: August 08, 2015, 01:34:32 AM »
sorry for the delayed Response, the double feature command isn't as important as the basic "cinema experience" command, I figured I could post it along with my other two commands sense I saw that others had asked for the double feature command,

I think what you originally posted should work fine with the movie IDs, if you can find a way to work around the Microsoft bug.

In the command you posted, the only thing that seemed to be missing was an action to then play the playlist after everything is queued.

yours worked (well the movie ids anyway), after I noticed that VC wasn't connected to XBMC (testing computer so XBMC isn't open all the time), In my command the first video is Player.Open then it clears the playlist and then adds all the extra videos to the playlist ( if I don't clear the playlist after launching the first video it would play the first two videos twice)  ::hmm
Quote
It probably works if you have a smaller number of movies in your XML file
Quote
P.S. I have a little over 100 movies in my movies payloadXML

Ya my movie collection is around 250, so I can see that being a problem, I did test it using xbmcMoviesIDs.xml {1} and xbmcMovies.xml {2} and that worked, but then i checked the payload sizes and xbmcMoviesIDs generates 292 movies where xbmcMovies generates 254 movies not sure why that is,

but when i get some more time I'll post the the other two command that I have "Theater Experience" used while browsing movies and "Theater Experience anywhere" used from anywhere in XBMC/KODI

Thanks for all the help and info you guys are great :clap ::bow