1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| import java.util.Locale;
import javax.speech.*;
import javax.speech.synthesis.*;
public class Bienvenue {
public static void main(String args[]) {
String texteASynthetiser;
texteASynthetiser= "Bonjour";
texteASynthetiser+="<EMP LEVEL=\"strong\">" + "mon nom est " + "</EMP>";
texteASynthetiser+="<EMP LEVEL=\"reduced\">" + "Ordinateur" + "</EMP>";
try {
Synthesizer synth = Central.createSynthesizer( new
SynthesizerModeDesc(Locale.FRENCH));
synth.allocate();
synth.speak(texteASynthetiser, null);
synth.speak("fin du message", null);
synth.deallocate() ;
}catch (Exception e) {
e.printStackTrace();
}
}
} |
Partager