0
我有一個關於Java的AWS拉姆達以下問題:onPlaybackNearlyFinished不起作用
稱爲「PlaybackNearlyFinished」不工作的意圖,又名,不播放音頻文件我餵養它。任何人都可以精確地解釋爲什麼這不起作用?
這是我的Java代碼:
@Override
public SpeechletResponse onPlaybackFinished(SpeechletRequestEnvelope<PlaybackFinishedRequest>
speechletRequestEnvelope) {
// logging info("onPlaybackFinished start");
SpeechletResponse response = new SpeechletResponse();
Stream stream = new Stream();
stream.setToken("test mp3");
stream.setUrl("https://ia802508.us.archive.org/5/items/testmp3testfile/mpthreetest.mp3");
stream.setOffsetInMilliseconds(0);
AudioItem audioItem = new AudioItem();
audioItem.setStream(stream);
PlayDirective playDirective = new PlayDirective();
playDirective.setAudioItem(audioItem);
playDirective.setPlayBehavior(PlayBehavior.REPLACE_ALL);
List<Directive> directives = new ArrayList<>();
directives.add(playDirective);
response.setDirectives(directives);
response.setShouldEndSession(true);
// logging info("onPlaybackFinished end, return testmp3");
return response;
}