Google Action和.mp3播放问题

时间:2018-11-19 01:27:37

标签: actions-on-google

我对Actions开发还很陌生。我有几个问题。

首先:我需要播放一些.mp3文件。一切都可以使用SSML agent.add(audiofile)正常运行,但是如果我使用agent.add(new Card({ [...]添加卡,则可以在智能手机(或模拟器)的屏幕上清楚地看到整个SSML输出,例如:<speak><audio src...>等。就在卡之前。 代码是这样的:

function welcome(agent) {
    var say = `<speak>
    <audio src="` + randomPhrase(welcomeMsgLungo) + `">
    <desc>Welcome Message</desc>
    Welcome
    </audio>
    </speak>`;
    agent.add(new Card({
         title: `cardtitle`,
         imageUrl: largeImageUrl,
         text: autore,
         buttonText: 'textSample',
         buttonUrl: 'https://assistant.google.com/'
       })
    );
    agent.add(say);
  }

0 个答案:

没有答案