hi i have try your code and there is several error like ( i use FreeTTS 1.2.1 ) : Voice cannot be initialized because it's an abstact class.
Your TextSpeaker.java in main method should add SynthesizerModeDesc we can not create Central.createSynthesizer(null) , so the main should be like this :
public static void main (String [] args)
{
try
{
// Create a synthesizer for the default
// locale.
SynthesizerModeDesc desc = new SynthesizerModeDesc(
null, // engine name
"general", // mode name
Locale.US, // locale
null, // running
null); // voice
synth = Central.createSynthesizer(desc);
// Allocate synthesizer resources.
synth.allocate ();
// Place synthesizer in the RESUMED
// state so that it can produce speech
// as it receives text.
synth.resume ();
}
catch (Exception e)
{
JOptionPane.showMessageDialog (null,
e.getMessage ());
System.exit (0);
}
createGUI ().setVisible (true);
}
for speaker. java i have not try it. Btw i have a question like if i want change the locale to GERMAN or ITALY what should i do to make it's run ?
thanks,
HKS |