Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Getting started with Udoo

You're reading from  Getting started with Udoo

Product type Book
Published in Feb 2015
Publisher
ISBN-13 9781784391942
Pages 206 pages
Edition 1st Edition
Languages

Improving user interaction with voice synthesis


Even if the Chronotherm application is working correctly, we have at least one more thing to do: providing proper feedback to let users know the action that was taken. Indeed, both activities fail to provide any visual feedback about what the recognized input is; for this reason, we decided to introduce the voice synthesis API within the initial design.

Because we want to share the synthesis procedure across different activities, we could create a manager that abstracts the synthesis API with a common initialization. The idea is to provide a class that exposes the method to start voice recognition with the given string; we implement it in the following steps:

  1. Create the VoiceManager class inside the voice package.

  2. Initialize the class with the following code:

    public class VoiceManager implements TextToSpeech.OnInitListener {
      private TextToSpeech mTts;
      //...
    }

    This class implements the OnInitListener interface that defines the callback that should...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}