Im quite new too but i will try to help you with it.
First of all you need to import the classes from your importet lib. (which you can download at
http://mary.dfki.de/download/index.html[
^]. Btw. its the runtimepackage so you dont need the server...
To set up your interface you need the following:
import marytts.LocalMaryInterface;
import marytts.MaryInterface;
The example is writing a wave called thisIsMyText in your tmp folder on your system.
After this you have to open it and then you can play it.
try this to play the wave within your project.
try {
AudioInputStream input = AudioSystem.getAudioInputStream(new File("/tmp/thisIsMyText.wav"));
SourceDataLine line = AudioSystem.getSourceDataLine(input.getFormat());
line.open(input.getFormat());
line.start();
byte[] buffer = new byte[1024];
int count;
while((count = input.read(buffer, 0, 1024)) != -1) {
line.write(buffer, 0, count);
}
line.drain();
line.stop();
line.close();
} catch(Exception e) {
e.printStackTrace();
}