带有Audioplayer的alexaskill被卡在混响中,而在回声点中却可以正常工作

时间:2018-07-11 13:11:14

标签: audio alexa-skills-kit

我使用了从github下载的alexa skill-sample-nodejs-audio-player。该技能中有4个音频流。所有音频流都在回声点设备中逐一播放。然后我在混响中进行测试,发现它只播放了两个音频流,然后卡住了。

从所附的Cloudwtach中,我发现第二个音频流中的事件“ AudioPlayer.PlaybackNearlyFinished”无法正常工作,它没有响应以下音频流url,而是发出“类型”: System.ExceptionEncountered”。

可能是混响错误吗?因为它在回声点中工作正常。我尝试了音频播放器的几种不同的网络技巧,结果是相同的,它被卡在第二个音频流中,并拒绝继续播放。

有人有同样的问题并且知道如何解决吗?

2018-07-11T09:17:28.573Z    3b70335e-84eb-11e8-9f0f-dbfadb5633d1    
{
    "version": "1.0",
    "response": {
        "shouldEndSession": false,
        "outputSpeech": {
            "type": "SSML",
            "ssml": "<speak> Welcome to the AWS Podcast. You can say, play the audio to begin the podcast. </speak>"
        },
        "reprompt": {
            "outputSpeech": {
                "type": "SSML",
                "ssml": "<speak> You can say, play the audio, to begin. </speak>"
            }
        }
    },
    "sessionAttributes": {
        "playOrder": [
            0,
            1,
            2,
            3
        ],
        "index": 0,
        "offsetInMilliseconds": 0,
        "loop": false,
        "shuffle": false,
        "playbackIndexChanged": true
    },
    "userAgent": "ask-nodejs/1.0.25 Node/v6.10.3"
}

2018-07-11T09:17:40.153Z    426ab3e7-84eb-11e8-83cd-71947976fd30    
{
    "version": "1.0",
    "session": {
        "new": false,
        "sessionId": "amzn1.echo-api.session.3a05e26d-22ee-4cb5-b712-f97b50b6c383",
        "application": {
            "applicationId": "amzn1.ask.skill.cb142216-89c3-4630-9837-d426bfd3b189"
        },
        "attributes": {
            "loop": false,
            "index": 0,
            "offsetInMilliseconds": 0,
            "shuffle": false,
            "playbackIndexChanged": true,
            "playOrder": [
                0,
                1,
                2,
                3
            ]
        },
        "user": {
            "userId": " "
        }
    },
    "context": {
        "AudioPlayer": {
            "playerActivity": "IDLE"
        },
        "System": {
            "application": {
                "applicationId": " "
            },
            "user": {
                "userId": " "
            },
            "device": {
                "deviceId": " ",
                "supportedInterfaces": {
                    "AudioPlayer": {}
                }
            },
            "apiEndpoint": "https://api.amazonalexa.com",
            "apiAccessToken": " "
        }
    },
    "request": {
        "type": "IntentRequest",
        "requestId": "amzn1.echo-api.request.695a1d1a-c238-4515-a982-604e49fcf709",
        "timestamp": "2018-07-11T09:17:40Z",
        "locale": "en-US",
        "intent": {
            "name": "PlayAudio",
            "confirmationStatus": "NONE"
        }
    }
}


2018-07-11T09:17:40.242Z    426ab3e7-84eb-11e8-83cd-71947976fd30    
{
    "version": "1.0",
    "response": {
        "shouldEndSession": true,
        "card": {
            "type": "Simple",
            "title": "Playing Episode 139",
            "content": "Playing Episode 139"
        },
        "outputSpeech": {
            "type": "SSML",
            "ssml": "<speak> This is Episode 139 </speak>"
        },
        "directives": [
            {
                "type": "AudioPlayer.Play",
                "playBehavior": "REPLACE_ALL",
                "audioItem": {
                    "stream": {
                        "url": "https://www.lanleag.com/php/users/share/alexa/apple.mp3",
                        "token": "0",
                        "expectedPreviousToken": null,
                        "offsetInMilliseconds": 0
                    }
                }
            }
        ]
    },
    "sessionAttributes": {
        "loop": false,
        "index": 0,
        "offsetInMilliseconds": 0,
        "shuffle": false,
        "playbackIndexChanged": false,
        "playOrder": [
            0,
            1,
            2,
            3
        ],
        "enqueuedToken": null,
        "STATE": "_PLAY_MODE"
    },
    "userAgent": "ask-nodejs/1.0.25 Node/v6.10.3"
}




2018-07-11T09:17:44.616Z    451672d6-84eb-11e8-b4e0-f97b80a2d426    
{
    "version": "1.0",
    "context": {
        "AudioPlayer": {
            "offsetInMilliseconds": 231,
            "token": "0",
            "playerActivity": "PLAYING"
        },
        "System": {
            "application": {
                "applicationId": "amzn1.ask.skill.cb142216-89c3-4630-9837-d426bfd3b189"
            },
            "user": {
                "userId": " "
            },
            "device": {
                "deviceId": " ",
                "supportedInterfaces": {
                    "AudioPlayer": {}
                }
            },
            "apiEndpoint": "https://api.amazonalexa.com",
            "apiAccessToken": " "
        }
    },
    "request": {
        "type": "AudioPlayer.PlaybackStarted",
        "requestId": "amzn1.echo-api.request.1712ac78-dc6e-40b3-89e9-f2922b4c18aa",
        "timestamp": "2018-07-11T09:17:44Z",
        "locale": "en-US",
        "token": "0",
        "offsetInMilliseconds": 231
    }
}


2018-07-11T09:17:44.714Z    451672d6-84eb-11e8-b4e0-f97b80a2d426    
{
    "version": "1.0",
    "response": {
        "shouldEndSession": true
    },
    "sessionAttributes": {
        "loop": false,
        "index": 0,
        "STATE": "_PLAY_MODE",
        "offsetInMilliseconds": 0,
        "shuffle": false,
        "enqueuedToken": null,
        "playbackIndexChanged": false,
        "playOrder": [
            0,
            1,
            2,
            3
        ],
        "token": "0",
        "playbackFinished": false
    }
}

2018-07-11T09:17:45.314Z    457f1fbc-84eb-11e8-b891-0169efdfd68a    
{
    "version": "1.0",
    "context": {
        "AudioPlayer": {
            "offsetInMilliseconds": 0,
            "token": "0",
            "playerActivity": "PLAYING"
        },
        "System": {
            "application": {
                "applicationId": "amzn1.ask.skill.cb142216-89c3-4630-9837-d426bfd3b189"
            },
            "user": {
                "userId": " "
            },
            "device": {
                "deviceId": " ",
                "supportedInterfaces": {
                    "AudioPlayer": {}
                }
            },
            "apiEndpoint": "https://api.amazonalexa.com",
            "apiAccessToken": " "
        }
    },
    "request": {
        "type": "AudioPlayer.PlaybackNearlyFinished",
        "requestId": "amzn1.echo-api.request.667b6b27-52a9-4d38-96af-3b634cd5d7a5",
        "timestamp": "2018-07-11T09:17:45Z",
        "locale": "en-US",
        "token": "0",
        "offsetInMilliseconds": 0
    }
}

2018-07-11T09:17:45.411Z    457f1fbc-84eb-11e8-b891-0169efdfd68a    
******************* RESPONSE **********************



2018-07-11T09:17:45.411Z    457f1fbc-84eb-11e8-b891-0169efdfd68a    
{
    "version": "1.0",
    "response": {
        "shouldEndSession": true,
        "directives": [
            {
                "type": "AudioPlayer.Play",
                "playBehavior": "ENQUEUE",
                "audioItem": {
                    "stream": {
                        "url": "https://www.lanleag.com/php/users/share/alexa/banana.mp3",
                        "token": "1",
                        "expectedPreviousToken": "0",
                        "offsetInMilliseconds": 0
                    }
                }
            }
        ]
    },
    "sessionAttributes": {
        "loop": false,
        "index": 0,
        "STATE": "_PLAY_MODE",
        "offsetInMilliseconds": 0,
        "playbackFinished": false,
        "shuffle": false,
        "enqueuedToken": "1",
        "playbackIndexChanged": false,
        "playOrder": [
            0,
            1,
            2,
            3
        ],
        "token": "0"
    },
    "userAgent": "ask-nodejs/1.0.25 Node/v6.10.3"
}


2018-07-11T09:17:46.481Z    4632df62-84eb-11e8-830e-ebaf36e88fda    
{
    "version": "1.0",
    "context": {
        "AudioPlayer": {
            "offsetInMilliseconds": 225,
            "token": "1",
            "playerActivity": "PLAYING"
        },
        "System": {
            "application": {
                "applicationId": "amzn1.ask.skill.cb142216-89c3-4630-9837-d426bfd3b189"
            },
            "user": {
                "userId": " "
            },
            "device": {
                "deviceId": " ",
                "supportedInterfaces": {
                    "AudioPlayer": {}
                }
            },
            "apiEndpoint": "https://api.amazonalexa.com",
            "apiAccessToken": " "
        }
    },
    "request": {
        "type": "AudioPlayer.PlaybackStarted",
        "requestId": "amzn1.echo-api.request.c90a8297-d2e5-4842-80b1-a63587fdda4f",
        "timestamp": "2018-07-11T09:17:46Z",
        "locale": "en-US",
        "token": "1",
        "offsetInMilliseconds": 225
    }
}



2018-07-11T09:17:46.533Z    4632df62-84eb-11e8-830e-ebaf36e88fda    
{
    "version": "1.0",
    "response": {
        "shouldEndSession": true
    },
    "sessionAttributes": {
        "loop": false,
        "index": 1,
        "STATE": "_PLAY_MODE",
        "offsetInMilliseconds": 0,
        "playbackFinished": false,
        "shuffle": false,
        "enqueuedToken": "1",
        "playbackIndexChanged": false,
        "playOrder": [
            0,
            1,
            2,
            3
        ],
        "token": "1"
    }
}



2018-07-11T09:17:47.071Z    468d0c9b-84eb-11e8-aef6-2567266bbf42    
{
    "version": "1.0",
    "context": {
        "AudioPlayer": {
            "offsetInMilliseconds": 0,
            "token": "1",
            "playerActivity": "PLAYING"
        },
        "System": {
            "application": {
                "applicationId": "amzn1.ask.skill.cb142216-89c3-4630-9837-d426bfd3b189"
            },
            "user": {
                "userId": " "
            },
            "device": {
                "deviceId": " ": {
                    "AudioPlayer": {}
                }
            },
            "apiEndpoint": "https://api.amazonalexa.com",
            "apiAccessToken": " "
        }
    },
    "request": {
        "type": "AudioPlayer.PlaybackNearlyFinished",
        "requestId": "amzn1.echo-api.request.605d38cd-116b-4bbe-b138-36059cc0a480",
        "timestamp": "2018-07-11T09:17:47Z",
        "locale": "en-US",
        "token": "1",
        "offsetInMilliseconds": 0
    }
}


2018-07-11T09:17:47.148Z    4698a54a-84eb-11e8-ab33-f10ed9dc12f2    
{
    "version": "1.0",
    "context": {
        "AudioPlayer": {
            "offsetInMilliseconds": 0,
            "token": "1",
            "playerActivity": "PLAYING"
        },
        "System": {
            "application": {
                "applicationId": "amzn1.ask.skill.cb142216-89c3-4630-9837-d426bfd3b189"
            },
            "user": {
                "userId": " "
            },
            "device": {
                "deviceId": " ",
                "supportedInterfaces": {
                    "AudioPlayer": {}
                }
            },
            "apiEndpoint": "https://api.amazonalexa.com",
            "apiAccessToken": " "
        }
    },
    "request": {
        "type": "System.ExceptionEncountered",
        "requestId": "amzn1.echo-api.request.b7bc750e-96ae-4ec2-8b7e-1d15978530de",
        "timestamp": "2018-07-11T09:17:47Z",
        "locale": "en-US",
        "error": {
            "type": "INVALID_RESPONSE",
            "message": "SpeechletResponse was null"
        },
        "cause": {
            "requestId": "amzn1.echo-api.request.605d38cd-116b-4bbe-b138-36059cc0a480"
        }
    }
}

2018-07-11T09:17:47.189Z    4698a54a-84eb-11e8-ab33-f10ed9dc12f2    
{
    "version": "1.0",
    "response": {
        "shouldEndSession": false,
        "outputSpeech": {
            "type": "SSML",
            "ssml": "<speak> Sorry, I could not understand. You can say, Next or Previous to navigate through the playlist. </speak>"
        },
        "reprompt": {
            "outputSpeech": {
                "type": "SSML",
                "ssml": "<speak> Sorry, I could not understand. You can say, Next or Previous to navigate through the playlist. </speak>"
            }
        }
    },
    "sessionAttributes": {
        "loop": false,
        "index": 1,
        "STATE": "_PLAY_MODE",
        "offsetInMilliseconds": 0,
        "playbackFinished": false,
        "shuffle": false,
        "enqueuedToken": "1",
        "playbackIndexChanged": false,
        "playOrder": [
            0,
            1,
            2,
            3
        ],
        "token": "1"
    },
    "userAgent": "ask-nodejs/1.0.25 Node/v6.10.3"
}

0 个答案:

没有答案