0

For context, I am building a skill that involves recorded narrations as audio streams.

  • For one of the narrations, a question will be posed to the user (recorded as part of the narrations)
  • The user's intent, captured using this.response.listen(), will determine the next set of narration to play

My issue is the following - as part of the Skill requires audio playback, I am using the AudioPlayerInterfaces. I encounter the error at the following part (see code below with comment):

var audioEventHandlers = {
  'PlaybackStarted': function() {
    this.emit(':responseReady');
  },
  'PlaybackFinished': function() {
    if (currentStream.keyName === 'intro') {
      this.response.listen(); //<-- this line causes the error
    }
    this.emit(':responseReady');
  }, //additional handler code omitted as not relevant

Specifically, the error triggered by this.response.listen() is:

"error": {
            "type": "INVALID_RESPONSE",
            "message": "The following directives are not supported: Response may not contain an reprompt,Response may not have shouldEndSession set to false"
        },

I have seen other Skills utilizes recordings, followed by a .listen() prompt, so I know that this is technically feasible. I was wondering how I should be approaching this?

Thanks!

daspianist
  • 5,336
  • 8
  • 50
  • 94
  • Per the documentation "Note: If your skill uses the AudioPlayer directives, you cannot extend the above built-in intents with your own sample utterances." and 'Note: When responding to AudioPlayer requests, you can only respond with AudioPlayer directives. The response cannot include any of the standard properties such as outputSpeech. In addition, some requests limit the directives you can use, such as not allowing Play. Sending a response with unsupported properties causes an error. See the request types below for the limits on each request.' – Chuck LaPress Sep 16 '18 at 23:29
  • The ability to have audio content with .listen is through the building of a skill with audio tags and not through the AudioHandlers It only can accept the responses outlined here: https://developer.amazon.com/docs/custom-skills/audioplayer-interface-reference.html – Chuck LaPress Sep 16 '18 at 23:32
  • Thanks for the insights Chuck. It seems that its not possible to append a .listen to an Audio Playing. – daspianist Sep 17 '18 at 11:02

0 Answers0