import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;

public class Bienvenue {
  public static void main(String args[]) { 
    try {
      Synthesizer synth = Central.createSynthesizer(
        new SynthesizerModeDesc(Locale.FRENCH));

      synth.allocate();
      MonSpeakable monSpeak = new MonSpeakable();
        synth.speak(monSpeak, null);

      synth.speak("fin du message", null);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

class MonSpeakable implements Speakable {
  public String getJSMLText() {
    StringBuffer buf = new StringBuffer();
    buf.append("Bienvenue à ce séminaire. Bonjour ");
    buf.append("<EMP LEVEL=\"strong\">" + "mesdames" + "</EMP>");
    buf.append(", bonjour " + "<EMP LEVEL=\"reduced\">" + "messieurs" + "</EMP>");
    buf.append("<BREAK MSECS=\"1000\" />");

    buf.append("avec la balise SAYAS, le sigle "+"<SAYAS SUB=\"S S deux zI\">" + "SSII" + "</SAYAS>");
    buf.append("<BREAK MSECS=\"1000\" />");
    buf.append("sans balise" + "SSII");
    buf.append("<BREAK MSECS=\"1000\" />");

    buf.append("<PROS PITCH=\"100\">" + "essai d'une voix grave" + "</PROS>");
    buf.append("<PROS PITCH=\"200\">" + "essai d'une voix aiguë" + "</PROS>");
    buf.append("<BREAK MSECS=\"1000\" />");

    buf.append("<PROS VOL=\"0.1\">" + "en parlant très doucement" + "</PROS>");
    buf.append("<BREAK MSECS=\"1000\" />");

    buf.append("<PROS VOL=\"0.9\">" + "ou encore très fort." + "</PROS>");
    buf.append("<BREAK MSECS=\"1000\" />");
    buf.append("êtes vous convaincu ?");
    return buf.toString();
  }
}
