import java.util.*;
import javax.speech.AudioException;
import javax.speech.Central;
import javax.speech.EngineException;
import javax.speech.synthesis.Synthesizer;
import javax.speech.synthesis.SynthesizerModeDesc;
class jarvis_part1
{
void inout()
{
try
{
System.setProperty("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(new SynthesizerModeDesc(Locale.US));
// Allocate synthesizer
synthesizer.allocate();
// Resume Synthesizer
synthesizer.resume();
// speaks the given text until queue is empty.
synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
synthesizer.speakPlainText("Jarvis welcomes you .",null );
}
catch (Exception e)
{
System.out.println("e");
}
}
public static void main(String args[])
{
jarvis_part1 ob=new jarvis_part1();
ob.inout();
}
}
Nesta página do site você pode assistir ao vídeo on-line text to speech in java duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Raj Sahu 25 Maio 2019, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 328 vezes e gostou 6 espectadores. Boa visualização!