Book Image

Voice Application Development for Android

Book Image

Voice Application Development for Android

Overview of this book

Speech technology has been around for some time now. However, it has only more recently captured the imagination of the general public with the advent of personal assistants on mobile devices that you can talk to in your own language. The potential of voice apps is huge as a novel and natural way to use mobile devices. Voice Application Development for Android is a practical, hands-on guide that provides you with a series of clear, step-by-step examples which will help you to build on the basic technologies and create more advanced and more engaging applications. With this book, you will learn how to create useful voice apps that you can deploy on your own Android device in no time at all. This book introduces you to the technologies behind voice application development in a clear and intuitive way. You will learn how to use open source software to develop apps that talk and that recognize your speech. Building on this, you will progress to developing more complex apps that can perform useful tasks, and you will learn how to develop a simple voice-based personal assistant that you can customize to suit your own needs. For more interesting information about the book, visit http://lsi.ugr.es/zoraida/androidspeechbook
Table of Contents (19 chapters)
Voice Application Development for Android
Credits
Foreword
About the Authors
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Afterword
Index

FormFillLib


To build a form-filling app, we must specify a data structure such as the one in the flight example. To do this, we define two classes: Form and Field. As shown in the UML diagram, a Form has a collection of Fields, and a Field has five attributes; a name, a string representing the prompt that the app will use to ask for the piece of data, two strings representing the prompts to be used when the app does not understand the user's response to the initial prompt (nomatch), or does not hear it (noinput), and the value that has been understood by the app.

For example, the Field flight setting could have the following values for its attributes:

name: Destination

prompt: What is your destination?

nomatch: Sorry, I did not understand what you said

noinput: Sorry, I could not hear you

value: Rome (when the user has said Rome in response to the system prompt)

This structure will suffice to build an app of the type we are discussing in this chapter. It is only necessary to create as many objects...