首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Alexa自定义技能-与其他技能交互

Alexa自定义技能-与其他技能交互
EN

Stack Overflow用户
提问于 2019-10-28 17:17:29
回答 1查看 49关注 0票数 0

我想用一种特别的方式演奏一首特别的歌。

代码语言:javascript
复制
 let speechText = ``;//Happy ${currentYear - year}th birthday!`;
    if (currentDate.getTime() !== nextBirthday.getTime()) {
        if(currentDate.getTime() > nextBirthday.getTime()){
            speechText = `Ciao Alberto! Hai già festeggiato il tuo compleanno quest'anno!!, Ti sei divertito?`;
        } else {
            const diffDays = Math.round(Math.abs((currentDate.getTime() - nextBirthday.getTime())/oneDay));
            speechText = `Ciao Alberto! Mancano ${diffDays} giorni al tuo primo compleanno!! Sei emozionato?`;
            //speechText = `Welcome back. It looks like there are ${diffDays} days until your ${currentYear - year}th birthday.`
        }
    } else {
        // PLAY THAT SONG
    }

如果可能的话,你能在正确的文档上告诉我吗?谢谢。

EN

回答 1

Stack Overflow用户

发布于 2019-11-07 01:24:30

我找到了解决方案:

代码语言:javascript
复制
else{
        expectedPreviousToken = 'sometoken' + Math.random();
        return handlerInput.responseBuilder
            //.speak('start playing sound')
                .addAudioPlayerPlayDirective('REPLACE_ALL', podcastURL, expectedPreviousToken, 0, null)
                 .withSimpleCard('Example', 'Example')
                 .getResponse();}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58588294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档