JSAPI 2.0

Package javax.speech.synthesis

Provides interfaces and classes for using speech Synthesizers.

See:
          Description

Interface Summary
Speakable Provides a standard method for obtaining markup text from an object.
SpeakableListener The listener interface for receiving notification of events during processing of items on the Synthesizer output queue.
Synthesizer Provides primary access to speech synthesis capabilities.
SynthesizerListener The listener interface for receiving notification of SynthesizerEvents associated with a Synthesizer.
SynthesizerProperties Provides run-time control of the properties of a Synthesizer.
 

Class Summary
PhoneInfo Provides dynamic information associated with a phoneme.
SpeakableEvent Event issued during processing of an item on the Synthesizer output queue.
SpeakableExceptionDetail Describes a problem found during processing of an item placed on the Synthesizer output queue.
SynthesizerEvent Event issued by a Synthesizer to indicate a change in state or other activity.
SynthesizerMode Provides information about a specific operating mode of a Synthesizer.
Voice Describes one output Voice of a speech Synthesizer.
 

Exception Summary
SpeakableException Thrown if a problem is found with an item placed on the Synthesizer output queue.
 

Package javax.speech.synthesis Description

Provides interfaces and classes for using speech Synthesizers.

The Synthesizer class provides methods to interact with speech synthesis Engines. The Overview provides more general information and includes a Table of Examples and a Table of Diagrams.

Here is a "Hello World" example for synthesis:


import javax.speech.*;
import javax.speech.synthesis.*;

public class HelloWorld {
    public static void main(String args[]) {
        try {
            // Create a synthesizer for the default speech locale
            Synthesizer synth = (Synthesizer)
                EngineManager.createEngine(SynthesizerMode.DEFAULT);

            // Get it ready to speak
            synth.allocate();

            // Speak the "Hello world" string
            synth.speak("Hello, world!", null);

            // Clean up - includes waiting for the queue to empty
            synth.deallocate();
        } 
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Since:
CLDC 1.0, MIDP 1.0, J2SE 1.3.1
See Also:
Synthesizer, EngineManager

JSAPI 2.0

JavaTM Speech API 2.0, Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.

Free Web Hosting