Download - Hour of Code - Amazon Alexa
行動開發學院 MobileDev.TW
Alexa Devices
$179.99 US$49.99 US$129.99
插電使用 插電使用 電量充飽 約9hr
聲控 聲控 按鈕 / 聲控
單聲道 立體聲 立體聲 & 杜比
5
行動開發學院 MobileDev.TW
Gartner 預測• 2018年,會有超過20億人會以對話的形式來與虛
擬個人助理、智慧型手機以及連網裝置進行互動• 2020年,40%的使用者會以對話的形式為主來使
用支援人工智慧應用程式• 2020年,25%的家庭會有兩個甚至更多的智慧語
音助理喇叭
Source:http://iveybusinessreview.ca/11
行動開發學院 MobileDev.TW
25,000第三方技能
Alexa News
15
付費技能In Skill Purchase
Amazon Pay
2,400萬2017智慧喇叭銷售
80國家可訂購Echo
3語言(英、德、日)
Source:StrategyAnalytics,AmazonAlexaBlog
英式英文
美式英文
加拿大式英文
印度式英文
澳洲式英文
行動開發學院 MobileDev.TW
Alexa Skill Store
https://www.amazon.com/alexa-skills/b/ref=topnav_storetab_a2s?ie=UTF8&node=13727921011
16
行動開發學院 MobileDev.TW
最熱門的技能種類 (2017/12)1. Games, Trivia & Accessories (5,184)2. News (3,474)3. Education & Reference(2,908)4. Music & Audio(2,303)5. Lifestyle(1,840)
17
行動開發學院 MobileDev.TW
2017/11/9 Alexa日文版上線
https://www.amazon.co.jp/alexa-skills/b/ref=topnav_storetab_a2s?ie=UTF8&node=5262653051
18
行動開發學院 MobileDev.TW
播放電影預告片
Showmesomelatestmovies.PlaythetrailerfornumberX.
19
https://www.youtube.com/watch?v=aKg85qEFMHs
行動開發學院 MobileDev.TW
播放音樂• Just say, “Alexa!” and then…–“Play [song name] by [artist]”.–“Pause” pauses the currently playing track.–“Play [Discover Weekly] playlist”.–“Volume up/down” turns volume up or down.–“Stop” stops the currently playing track.
21
行動開發學院 MobileDev.TW
設計方向• Fast–讓人們更快達成目的–語音控制音樂播放
• Easy–讓人們更簡單地達成目的–語音控制電燈開關、語音設定倒數計時
• Fun–增添生活趣味–具有挑戰性的遊戲
22
Source:VoiceDesignGuide– AmazonAlexa
行動開發學院 MobileDev.TW
互動腳本準則• 真實
ü以人們真正會說的話來設計,而不是那種文章上的口吻ü不要假設使用者知道要怎麼做或是知道會發生什麼事
• 明確ü避免使用有多重含義的詞句、片語ü引導使用者提供必要的資訊
• 簡單ü清楚地把選項呈現出來ü一般而言,一次不要丟出超過三個選項ü一次向使用者要一個資訊
23
行動開發學院 MobileDev.TW
Alexa, tell me a cold joke.• 任務–讓Alexa隨機說出一個冷笑話
• 建構步驟:–設定可接受的指令–設定可使用的冷笑話–進行測試
24
行動開發學院 MobileDev.TW
Alexa Skill Kit• 前端:設定互動模式– https://developer.amazon.com/alexa– Name, Invocation Name– Utterances, Slot type, Intent Schema
• 後端:程式邏輯開發與儲存– https://aws.amazon.com/tw/lambda/– Node.js
Source:Codecademy25
行動開發學院 MobileDev.TW
ASK 設定• Intent Schema–使用者的意圖,以及對應可執行的動作
• Custom Slot Type–特定資料型態與內容
• Sample Utterance–例句,將使用者的輸入對應至意圖
26
行動開發學院 MobileDev.TW
下載範例• http://0rz.tw/J9OKG
安裝開發環境• 安裝Node.js (到官網下載)• 檢查是否安裝成功–到終端機:node –v
• 檢查npm是否安裝–到終端機:npm
• 更新npm–到終端機:sudo npm install npm -g
49
行動開發學院 MobileDev.TW
開啟終端機安裝Alexa SDK• 檢視 -> 整合式終端機 (Ctrl + ~)• 移動至src資料夾 (cd src)• 安裝SDK– npm install alexa-sdk
• 壓縮 src資料夾中的檔案– zip -r -X coldJokeV1.zip .
54
行動開發學院 MobileDev.TW
應用程式邏輯
tellmeajoketellmeacoldjokegivemeajokegivemeacoldjokeshootmeacoldjpkeSurprisemewithacoldjoke
Joke1Joke2Joke3Joke4Joke5Joke6Joke7Joke8Joke9Joke10
61
Intent:GetNewJoke
行動開發學院 MobileDev.TW
Recap• 前端Developer站–設定Intent與例句 (記得Save & Build Model)
• 本地端 開發– VS Code、Alexa SDK、壓縮成zip
• 後端 AWS Lambda–地區、Basic Role、Trigger、程式包上傳
62