Author Topic: Payload dictation with numbers  (Read 2854 times)

0 Members and 1 Guest are viewing this topic.

Bray90820

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Payload dictation with numbers
« on: June 30, 2017, 07:14:11 PM »
So I am having a slight issue using my Alexa with Vox. I am using a payload dictation to play movies if I say play movie click or play movie good burger everything works. If I say play movie "born on the 4th of July" it reads it as 4th and doesn't recognize the command but if I use VoxWave on my phone it recognizes the command. It seems to happen that way  every time there is something with 1st 2nd 3rd etc...

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Payload dictation with numbers
« Reply #1 on: June 30, 2017, 07:28:05 PM »
Yes.  That's because Alexa chooses to spell it that way and in the case of some movies that spelling is going to be wrong.  It's not the only thing that Alexa gets wrong.  You could modify the Alexa skill to replace 4th with the word fourth but it's just one of many things that it is going to spell differently.  That's why using VoxCommando with a microphone or with VoxWav (which is a just acting as a WiFi microphone) is going to work better for most things.
« Last Edit: June 01, 2019, 01:20:42 PM by nime5ter »

Bray90820

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Payload dictation with numbers
« Reply #2 on: June 30, 2017, 07:30:30 PM »
Well the name of the movie is "born on the 4th of July" not "born on the Fourth of July" so I am not entirely sure why it's not being recognized when I tell alexa to play movie "born on the 4th of July" alexa responds with "VoxCommando Does not understand play movie born on the 4th of july"
« Last Edit: June 30, 2017, 07:32:57 PM by Bray90820 »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Payload dictation with numbers
« Reply #3 on: June 30, 2017, 07:36:11 PM »
VoxWav works completely different, because it send a recorded audio file to VoxCommando which does then the speech recognition.

One thing what you can do, is to edit the "custom slot types" in your VC Alexa skill in your Amazon development portal (see picture below), but I'm not sure if this will help a lot.
You can put (for testing) the complete movie title in, but type 4th how it will spoken "fourth" or type only fourth July - maybe this will work.
« Last Edit: June 30, 2017, 07:43:27 PM by Kalle »
***********  get excited and make things  **********

Bray90820

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Payload dictation with numbers
« Reply #4 on: June 30, 2017, 07:39:31 PM »
So just to understand correctly if the file is named 4th and alexa searches for 4th it will still fail? because right now that is what is happening

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Payload dictation with numbers
« Reply #5 on: June 30, 2017, 07:43:41 PM »
I'm not sure what is happening in your case but the according to IMDB the movie is named "Born on the Fourth of July".

http://www.imdb.com/title/tt0096969/

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Payload dictation with numbers
« Reply #6 on: June 30, 2017, 07:47:20 PM »
you can take a look in the VC history window to see what Alexa has understand.
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Payload dictation with numbers
« Reply #7 on: June 30, 2017, 07:50:50 PM »
It looks like maybe dictation payloads cannot handle things like "4th".  It's odd but if that is the case there is nothing that can be done to fix it other than to use a payload XML instead of dictation.  This must be a limitation of the Microsoft speech engine.

Bray90820

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Payload dictation with numbers
« Reply #8 on: June 30, 2017, 07:54:31 PM »
If that is the case and Microsoft speech can't Handel it would changing 4th to fourth in the skill be the way to go because vc history shows Born on the 4th of july  and I did manually edit the file name to read born on the 4th of july
« Last Edit: June 30, 2017, 07:57:55 PM by Bray90820 »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Payload dictation with numbers
« Reply #9 on: June 30, 2017, 09:14:09 PM »
Yes

Bray90820

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Payload dictation with numbers
« Reply #10 on: July 01, 2017, 12:15:04 AM »
So after some time playing with it I found out that it works with callout phrases I can correctly say the 4th of July and my action completes. this only seems to be a problem with Dictation which leads me to believe that it is something that can be fixed from within VoxCommando

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Payload dictation with numbers
« Reply #11 on: July 01, 2017, 08:06:54 AM »
No. As I said earlier it is a problem with dictation payloads and is a limitation of the Microsoft speech engine and therefore not something that can be fixed.

The solution is to use something other than dictation payloads or to avoid sending it digits instead of words.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Payload dictation with numbers
« Reply #12 on: July 01, 2017, 08:27:51 AM »
@Bray90820, typically for "play movie {1}" type commands we use payloadXML, not a dictation payload, as this provides a lot more control and reliability.

All the integrated media solutions that VC supports have a pre-made payloadXML generator. However, you can generate your payloadXML file(s) automatically even if you're not using one of these methods to play your media.

What is your "play movie" command actually doing?

« Last Edit: July 01, 2017, 09:47:20 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)

Bray90820

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Payload dictation with numbers
« Reply #13 on: July 01, 2017, 03:47:29 PM »
@Bray90820, typically for "play movie {1}" type commands we use payloadXML, not a dictation payload, as this provides a lot more control and reliability.

All the integrated media solutions that VC supports have a pre-made payloadXML generator. However, you can generate your payloadXML file(s) automatically even if you're not using one of these methods to play your media.

What is your "play movie" command actually doing?

I actually have sorta gotten it working with a work around by manually putting 4th in my script then having payload dictations to happen before and after the 4th but in any matter the play movie command is creating and running a bash script to connect to my plex server and play the movie I requested 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Payload dictation with numbers
« Reply #14 on: July 01, 2017, 05:16:22 PM »
I'm not sure I understand the work-around you are using based on your description.

If it's working for you then great.  Otherwise I can propose another solution.

Right now Alexa is generating an EVENT in VC which passes the spoken voice command in as a payload.  VoxCommando is then taking this payload and attempting to use emulated speech recognition using that string of text.  This is where it breaks, if your Alexa generated event payload contains numbers and the targeted voice command is using only dictation.

But we don't necessarily always have to use emulated recognition.  We could detect certain types of commands and treat them differently.

There are two general approaches to doing this. 

The first (and I think preferable) option would be to detect these special commands in the Amazon lambda code and generate a different event for those.

The second option, which is easier for me to show you is to do it all in VoxCommando.  Take a look at the attached group to see what I did.  Let me know if you need help adapting it.  Please make sure to remove any old commands that you are using which are triggered by the EchoToVc event.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.7-->
<commandGroup open="True" name="Alexa echo dot lambda" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="47" name="event to voice command" 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 movie</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Play.Movie</param>
            <param>{1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>TTS.Speak2Wav</cmdType>
      <params>
        <param>OK</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TellVox</cmdType>
      <params>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then />
      <else>
        <action>
          <cmdType>TCP.WebServer.SetResponse</cmdType>
          <params>
            <param>Jarvis does not understand {1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <action>
      <cmdType>TTS.GetLastText</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;{Var.LastTTS}</ifParams>
      <then />
      <else>
        <action>
          <cmdType>TCP.WebServer.SetResponse</cmdType>
          <params>
            <param>{LastResult}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>EchoToVC</event>
  </command>
  <command id="1256" name="play movie XYZ (for alexa)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.Replace</cmdType>
      <params>
        <param>play movie </param>
        <param />
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TCP.WebServer.SetResponse</cmdType>
      <params>
        <param>Playing movie {LastResult} on Plex.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Play.Movie</event>
  </command>
</commandGroup>