Alexa Trivia测验:尝试在新游戏消息中添加自定义音频文件

问题描述 投票:0回答:1

我正在尝试在Alexa测验中添加自定义音频文件,但似乎无法弄清楚。我基本上是在使用https://github.com/alexa/skill-sample-nodejs-quiz-game中的所有内容进行调整。以下是文本的JSON语音代码。另外,我不是真正的开发人员,而是业余爱好者,如果这完全没有道理,我感到抱歉。

const languageString = {
  en: {
    translation: {
      QUESTIONS: questions.QUESTIONS_EN_US,
      GAME_NAME: 'Trivia',
      HELP_MESSAGE: 'I will ask you %s multiple choice questions. Respond with the number of the answer. For example, say one, two, three, or four. To start a new game at any time, say, start game. ',
      REPEAT_QUESTION_MESSAGE: 'To repeat the last question, say, repeat. ',
      ASK_MESSAGE_START: 'Would you like to start playing?',
      HELP_REPROMPT: 'To give an answer to a question, respond with the number of the answer. ',
      STOP_MESSAGE: 'Would you like to keep playing?',
      QUIT_MESSAGE: 'Good bye.',
      CANCEL_MESSAGE: 'Ok, let\'s play again soon.',
      NO_MESSAGE: 'Ok, we\'ll play another time. Goodbye!',
      TRIVIA_UNHANDLED: 'Try saying a number between 1 and %s',
      HELP_UNHANDLED: 'Say yes to continue, or no to end the game.',
      START_UNHANDLED: 'Say start to start a new game.',
      NEW_GAME_MESSAGE:  'Welcome to %s. ',
      WELCOME_MESSAGE: 'I will ask you %s questions, try to get as many right as you can. Just say the number of the answer. Let\'s begin. ',
      ANSWER_CORRECT_MESSAGE: 'correct. ',
      ANSWER_WRONG_MESSAGE: 'wrong. ',
      CORRECT_ANSWER_MESSAGE: 'The correct answer is %s: %s. ',
      ANSWER_IS_MESSAGE: 'That answer is ',
      TELL_QUESTION_MESSAGE: 'Question %s. %s ',
      GAME_OVER_MESSAGE: 'You got %s out of %s questions correct. Thank you for playing!',
      SCORE_IS_MESSAGE: 'Your score is %s. '
    },
  },
javascript node.js json alexa amazon-lamda
1个回答
0
投票

您可以直接在响应字符串中添加标签,例如

playback = 'Here is a sound <audio src="soundbank://soundlibrary/animals/amzn_sfx_bear_groan_roar_01"/>';

需要注意的是要确保使用正确的引号。

这里是您可以使用的所有Amazon声音库声音的列表。https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html

您还可以直接转到alexa开发人员控制台,然后转到“语音和音调”选项卡以测试我们的语法。它将被封装在一个语音标签中,但是通常您确实需要担心,因为它会为您处理。

“

要插入的代码是:

<speak>
<audio src="soundbank://soundlibrary/animals/amzn_sfx_bear_groan_roar_01"/>
</speak>
© www.soinside.com 2019 - 2024. All rights reserved.