Código
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package sonido; import java.util.Locale; import javax.speech.Central; import javax.speech.synthesis.Synthesizer; import javax.speech.synthesis.SynthesizerModeDesc; /** * * @author pcx */ public class SonidoSp { /** * @param args the command line arguments */ // TODO code application logic here try { // Set property as Kevin Dictionary "freetts.voices", "com.sun.speech.freetts.en.us" + ".cmu_us_kal.KevinVoiceDirectory"); // Register Engine Central.registerEngineCentral( "com.sun.speech.freetts" + ".jsapi.FreeTTSEngineCentral"); // Create a Synthesizer Synthesizer synthesizer = Central.createSynthesizer( // Allocate synthesizer synthesizer.allocate(); // Resume Synthesizer synthesizer.resume(); // Speaks the given text // until the queue is empty. synthesizer.speakPlainText( "hola esto es carnaval tu p**a madre", null); synthesizer.waitEngineState( // Deallocate the Synthesizer. synthesizer.deallocate(); } e.printStackTrace(); } } }
Gracias su interés
[MOD] para publicar código usar las etiquetas GeSHi