Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting different response in alexa developer service simulator and in alexa app server testing utility #105

Open
rajeevs960 opened this issue Nov 30, 2017 · 7 comments
Labels

Comments

@rajeevs960
Copy link

rajeevs960 commented Nov 30, 2017

Hi ,

I am getting different responses in alexa developer service simulator and in your testing utility.

Response in alexa app server testing utility

{
  "version": "1.0",
  "response": {
    "directives": [
      {
        "type": "AudioPlayer.Play",
        "playBehavior": "REPLACE_ALL",
        "audioItem": {
          "stream": {
            "url": "https://songurl",
            "token": "123456",
            "offsetInMilliseconds": 0
          }
        }
      }
    ],
    "shouldEndSession": true,
    "outputSpeech": {
      "type": "SSML",
      "ssml": "<speak>playing the song shape of you from app</speak>"
    },
    "card": {
      "type": "Simple",
      "title": "My Cool Card",
      "content": "playing the song shape of you from app"
    }
  },
  "sessionAttributes": {}
}

Response in alexa developer service simulator:

{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "ssml": "<speak>playing the song shape of you from app</speak>",
      "type": "SSML"
    },
    "card": {
      "content": "playing the song shape of you from app",
      "title": "My Cool Card"
    },
    "speechletResponse": {
      "outputSpeech": {
        "ssml": "<speak>playing the song shape of you from app</speak>"
      },
      "card": {
        "content": "playing the song shape of you from app",
        "title": "My Cool Card"
      },
      "directives": [
        {
          "playBehavior": "REPLACE_ALL",
          "audioItem": {
            "stream": {
              "token": "123456",
              "url": "https://songurl",
              "offsetInMilliseconds": 0
            }
          }
        },
        {
          "template": {
            "title": "My Cool Card",
            "textContent": {
              "primaryText": {
                "richText": "<font size=\"7\">playing the song shape of you from app</font>"
              }
            },
            "backButtonBehavior": "HIDDEN"
          }
        }
      ],
      "shouldEndSession": true
    }
  },
  "sessionAttributes": {}
}  

why the "type": "AudioPlayer.Play" is not displaying in service simulator. The song is not playing. Only the text is saying by the device. And why "speechletResponse" object is displaying in service simulator. Am i doing anything wrong?. Please let me know the solution. I am facing the issue.

@benedekh
Copy link
Contributor

afaik, AudioPlayer is not supported yet in the simulator.

@rajeevs960
Copy link
Author

rajeevs960 commented Nov 30, 2017

yes its not supported. But in response its only displaying this

"directives": [
        {
          "playBehavior": "REPLACE_ALL",
          "audioItem": {
            "stream": {
              "token": "123456",
              "url": "https://songurl",
              "offsetInMilliseconds": 0
            }
          }
        },

the "type" : "AudioPlayer.Play" is not displaying. So is it because of AudioPlayer is not supported yet in the simulator?

and when i tested the same in the echo dot the song is not playing only the text is being played. Do you know any solution for this?

@benedekh
Copy link
Contributor

First question: I think so, but problably @dblock could verify it.

Second question: unfortunately no.

@dblock
Copy link
Collaborator

dblock commented Nov 30, 2017

If you're getting a different response to the same request from the same code there's probably a real problem somewhere. I would debug what's going on there, because regardless of which simulator you use I would expect the response to look the same.

Your first one is missing cards, etc., I think your code is taking different paths?

@dblock dblock added the bug? label Nov 30, 2017
@rajeevs960
Copy link
Author

rajeevs960 commented Nov 30, 2017

yes, i am not understanding how "speechletResponse" object is coming in service simulator. And the audioplayer.play type is missing in directive.
This is my code, i have removed the card . I am sending the songname which i get in slot to a method gettrackurl, from which i get the songurl and then i am sending the audioitem:

 return gettrackurl(req.slot('songName')).
     then(songURL=> {
 res.say("playing the song " +req.slot('songName')+" from app");
                var stream = {
                    "url": songURL,
                    "token": "123456",
                    "offsetInMilliseconds": 0
                };
                res.audioPlayerPlayStream("REPLACE_ALL", stream);
                return res.send(); 

please let me know if i have done anything wrong. I am getting proper response in your testing utility.

@rajeevs960
Copy link
Author

And even for link account the card object is showing empty in service simulator of amazon developer site.

@rajeevs960
Copy link
Author

I think there is a problem in service simulator of amazon developer site. Now i am able to play a song in echo dot. But still the service simulator doesn't show the proper response type for directives and card also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants