ワイズリマインダー

アレクサの応答に画像を表示させてみた

スキルを呼び出した時に、画像を表示させてみた

const LaunchRequestHandler = {
    canHandle(handlerInput) {
        return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest';
    },
    handle(handlerInput) {
        const speakOutput = '<audio src="https://www.hm.ysrock.com/api/test_mp3/wan1.mp3" />';
        const largeImageUrl = 'https://www.hm.ysrock.com/api/test_image/largeImageUrl.jpg';
        const smallImageUrl = 'https://www.hm.ysrock.com/api/test_image/smallImageUrl.jpg';

        return handlerInput.responseBuilder
            .speak(speakOutput)
            .withStandardCard('ダイです', 'なぁに?', smallImageUrl, largeImageUrl)
            .reprompt(speakOutput)
            .getResponse();
    }
};

 

 

画像ファイルは次の制限がある

※詳しくはAlexaSkillsKitを参照

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

検索

最近のコメント

最近の投稿

タグ

フィード配信

アーカイブ

外部リンク