JavaVoice
From Carboogle
Contents |
Overview
JavaVoice is a library that can be used to add Text-To-Speech support and Voice Recognition in Java. Only English language is available at the moment. It has been built with the Spring Framework and integrates two main components:
Usage
See the project sample to see how to declare Spring Beans.
Example to capture voice:
final RecognitionService service = VoiceServiceLocator.getDefaultInstance().getRecognitionService(); final Recognizer recognizer = service.getRecognizer("SIMPLE-RECOGNIZER"); recognizer.open(); recognizer.startRecording(); System.out.println("\nStart speaking some words (start | stop | pause | go | next | previous | new). Press Ctrl-C to quit.\n"); while (true) { }
Example of the speech API:
final Speaker v = VoiceServiceLocator.getDefaultInstance().getSpeakService().getSpeaker(voiceName); if (v == null) { } v.open(); v.speak("Hello you !"); v.close();
NB: The VoiceServiceLocator is a Singleton used to retrieve Spring beans.
Download
Requirements
Twister game
This is an example of a small program using this library. We can use this program when playing Twister at only two persons.
You only have to download the program, unzip it, and execute the good script in the bin folder. It will popup a swing dialog box so that you can choose a voice, then you just have to listen and speak to interact with the program.

