1 / 15

Lesson 1 Hello World – TTS

Lesson 1 Hello World – TTS . Created by Trungnd Hà Nội 2013. Yêu cầu :. Eclipse đã cài đặt ADT, Android SDK Cài đặt Robot SDK Ref: http ://ftri.fpt.edu.vn/robot/docs/NAO/SDK.html. Mục đích :. Hướng dẫn tạo 1 Robot Project Sử dụng 1 số API cơ bản của Robot Framework

ludlow
Download Presentation

Lesson 1 Hello World – TTS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lesson 1 Hello World – TTS Created by Trungnd HàNội 2013

  2. Yêucầu: • Eclipse đãcàiđặt ADT, Android SDK • Càiđặt Robot SDK Ref:http://ftri.fpt.edu.vn/robot/docs/NAO/SDK.html

  3. Mụcđích: • Hướngdẫntạo 1 Robot Project • Sửdụng 1 số API cơbảncủa Robot Framework • Sửdụng API Text To Speech (TTS) Offline • Sửdụng API Text To Speech (TTS) Online

  4. Task 1: Tạo 1 Robot project • Đầutiên, tạo 1 Android Project mới

  5. ChọnNextvàNextđểđếnmànhìnhActivity Selection  Chọn Robot Activity. SauđóchọnNextvàFinish.

  6. Kếtquả 1 project mớiđượctạoravớicấutrúc:

  7. Trong file AndroidManifest.xmlđượctạoracó 1 số element nhưsau:

  8. File MainActivity.java, đượctạorathừakếtừRobotActivityclass với 1 abstract method phải implement. • Method getLayoutID() trảvề resource id của layout cầnhiểnthị:

  9. Task 2: Hello World • Đasốcác API của Robot Framework phảitruyềnvàothamsốlà 1 Robot object. Object nàycóthểlấybằngcáchgọi method getRobot(). • 1 lưuýlàcác module của Robot nênđượcgọitừ 1 thread khác. • Tạo 1 layout main_layout.xmlnhưsau: ẤnvàocácnútSpeak robot sẽnói“xinchàocácbạn”. 2 nútcònlại robot sẽđứnglênvàngồixuống. • ThamkhảoAPI Docs

  10. Để Robot speak sửdụngcóthể module TTS offline. • Tươngứngvới 2 action cònlạisẽsửdụng module motion: • Link down code: Robot Tutorial

  11. Task 3: Sửdụng API TTS online • Tạo 1 Robot Project mới. • Tạo layout choứngdụng: • Đểsửdụng module TTS online: tạo 1 object TtsAudioGen(phảitruyềnvào 1 object ServerInfo: chứa link TTS server và password):

  12. Lưuý: Callback cho TTS online module là 1 object ITtsCallbackchứa 2 method phải implement:

  13. API chínhcủa module nàychínhlà method audioGen():

  14. Saukhitổnghợpđược audio file, cóthểđể robot play file nàythông qua RobotAudioPlayermodule: • Download code from Lesson 1 (TTS)

  15. Thanks for Listening!!!

More Related