Sample Speech Recognition and Text-to-Speech Application¶
Included as part of the Dragon Mobile SDK is a sample Eclipse project SampleVoiceApp, which presents a basic, complete demo of the network-based speech recognizer and Text-To-Speech synthesizer.
If you are developing using Eclipse on Windows, you can import the sample project with the following steps:
- From the menu, select: File ‣ Import
- In the Import dialog, select: General ‣ Existing Projects into Workspace and press Next.
- At the Select root directory: prompt, browse to the location of the “SampleVoiceApp” folder.
- Make sure that the SampleVoiceApp project is checked, then press Finish.
Note
SampleVoiceApp requires version 1.6 of the Java SDK. If the application is compiled with version 1.5, there may be compilation errors and the application might not function correctly.
Before you use this application, you must replace the placeholder application ID and key with values provided by Nuance for your developer account. You can obtain your ID and key from the Nuance Mobile Developer portal located at http://nuancemobiledeveloper.com/.
- Open the file SampleVoiceApp/src/com/nuance/nmdp/sample/AppInfo.java.
- Replace the SpeechKitApplicationKey[] value with your key.
- Replace SpeechKitAppId with parameter with your ID.
- Verify that SpeechKitServer and SpeechKitPort match the host and port provided by the portal, and change these values if necessary.
- You can now run the application: connect your device and select Build and Run.
Main View¶
When the sample application launches, the main view is displayed. From this view, the user can choose whether to test Dictation or Text-To-Speech.

Recognizer View¶
If the user chooses Dictation, the DictationView Activity is displayed.

Recognition View
This view has several sections:
The top of the screen has a text box that displays results or error messages.
The middle of the screen contains an area where a choice list can be displayed.
The bottom of the three screen has three buttons: Dictate, Websearch, and Get TTS.
- The Dictate and Websearch buttons allows the user test the two tests of recognition options.
- The Get TTS buttons allows the user to switch to the TtsView to easily play back text that was recognized.
Text-to-Speech View¶
When the sample application launches, the main text-to-speech view is displayed.

Text-to-Speech View
This view has two primary elements:
- A text entry field for defining the text to be spoken
- Buttons to start and stop the speech synthesis process.