使用流程
注意:Alexa Voice Service 不支持中文。
● 上电开机,如果没有配置网络,先进行配网。
● 将上面获得的Client ID 和 Product ID填入/oem/AlexaClientSDKConfig.json的deviceInfo属性:
"deviceInfo":{// Unique device serial number. e.g.123456"deviceSerialNumber":"123456", // The Client ID of the Product from developer.amazon.com"clientId":"YOUR_CLIENT_ID", // Product ID from developer.amazon.com"productId":"YOUR_PRODUCT_ID"},
● 执行下面命令启动 Alexa
SampleApp /oem/AlexaClientSDKConfig.json /oem/resources/
● 第一次启动需要进行认证授权,按提示打开对应网页,输入验证码进行认证即可
################################### NOT YET AUTHORIZED #################################################################################################################################### To authorize, browse to: 'https://amazon.com/us/code' and enter the code: AT4HLU ################################################################################################################################################### Checking for authorization (1)... ##################################################
● 认证过程中,稍等几分钟后,就可以与 Alexa 进行对话,可通过呼叫“alexa”唤醒,不过大部分交互体验都要通过命令行引导。
+----------------------------------------------------------------------------+|Options:||Wake word:||Simply say Alexa and begin your query.||Tap to talk:||Press't'and Enter followed by your query(no needforthe'Alexa').||Hold to talk:||Press'h'followed by Enter to simulate holding a button.||Then say your query(no needforthe'Alexa').||Press'h'followed by Enter to simulate releasing a button.||Stop an interaction:||Press's'and Enter to stop an ongoing interaction.||Privacy mode(microphone off):||Press'm'and Enter to turn on and off the microphone.||Echo Spatial Perception(ESP): This isfortesting purpose only!||Press'e'followed by Enter at anytimeto adjust ESP settings.||Playback Controls:||Press'1'fora'PLAY'button press.||Press'2'fora'PAUSE'button press.||Press'3'fora'NEXT'button press.||Press'4'fora'PREVIOUS'button press.||Settings:||Press'c'followed by Enter at anytimeto see the settings screen.||Speaker Control:||Press'p'followed by Enter at anytimeto adjust speaker settings.||Firmware Version:||Press'f'followed by Enter at anytimeto report a different||firmware version.||Info:||Press'i'followed by Enter at anytimeto see thehelpscreen.||Reset device:||Press'k'followed by Enter at anytimeto reset your device. This||will erase any data stored in the device and you will have to||re-register your device.||This option will alsoexitthe application.||Reauthorize device:||Press'z'followed by Enter at anytimeto re-authorize your device.||This will erase any data stored in the device and initiate||re-authorization.||Quit:||Press'q'followed by Enter at anytimeto quit the application.|+----------------------------------------------------------------------------+
资源
Alexa 源码目录:
SDK/external/alexaClientSDK/
Buildroot 的 Alexa package 目录:
SDK/buildroot/package/rockchip/alexaClientSDK/
Alexa 没有自启动入口,需要进入系统后自己手动启动Alexa,方法如上一节。如果需要自启动,则可以参考DuerOS。
编译方法
● 编译之前,亦可将上面获得的Client ID 和 Product ID填入SDK/device/rockchip/rk3308/alexa/AlexaClientSDKConfig.json的deviceInfo属性,这样固件就默认的带有了Client ID 和 Product ID信息。
"deviceInfo":{// Unique device serial number. e.g.123456"deviceSerialNumber":"123456", // The Client ID of the Product from developer.amazon.com"clientId":"YOUR_CLIENT_ID", // Product ID from developer.amazon.com"productId":"YOUR_PRODUCT_ID"},
● 甚至可以从已经认证过的设备中,拷贝/oem/application-necessities/cblAuthDelegate.db到SDK中device/rockchip/rk3308/alexa/application-necessities/cblAuthDelegate.db,这样Alexa就会跳过认证,直接开始对话。
● 编辑 device/rockchip/rk3308/BoardConfig.mk 文件,将OEM_PATH=oem修改为OEM_PATH=alexa,保存退出
● 配置 firefly_rk3308_release
sourcebuildroot/build/envsetup.sh
选择[1],按回车,配置成功后如下