How do you specify what the Java application says?

You can use prerecorded speech or text-to-speech in a Java voice application by using any of the following subclasses of MediaType. These media data classes specify the sounds that the caller hears:

You can also use arrays of the MediaType object to make a composite sequences of other media elements.

All the methods capable of playing a message can accept arrays of MediaTypes. This allows your applications to play chains of MediaType objects in one operation.