簡體   English   中英

Alexa Trivia Quiz:嘗試在新游戲消息中添加自定義音頻文件

[英]Alexa Trivia Quiz: trying to add custom audio file in the new game message

我正在嘗試在 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, ' }, },

您可以直接在響應字符串中添加標簽,例如

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

需要注意的是確保使用正確的引號。

這是您可以使用的所有亞馬遜聲音庫聲音的列表。 https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html

你也可以 go 到 alexa 開發者控制台和 go 到 Voice and Tone 選項卡來測試我們的語法。 它將被封裝在一個說話標簽中,但通常你必須擔心它是為你處理的。

Alexa 開發控制台[1]

要插入的代碼是:

<speak>
<audio src="soundbank://soundlibrary/animals/amzn_sfx_bear_groan_roar_01"/>
</speak>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM