Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

freetts problem, it is urgent

807580Aug 20 2008 — edited Nov 19 2009
this is the code of Freetts:


import java.net.*;
import java.security.*;
import com.sun.speech.freetts.Voice;
import java.lang.*;
import com.sun.speech.freetts.VoiceManager;
import com.sun.speech.freetts.audio.JavaClipAudioPlayer;
import javax.swing.JOptionPane;




public class test1 implements Runnable
{
String string ="";

test1(String str)
{

this.string = str;
System.out.print(string);
//JOptionPane.showMessageDialog(null,string);
run();
}

public void run(){

try{

Voice helloVoice;
VoiceManager voiceManager = VoiceManager.getInstance();
//System.out.println("subashis");

helloVoice = voiceManager.getVoice("kevin16");

System.out.println("subashis");
if (helloVoice == null) {
System.err.println(
"Cannot find a voice named "
+ ". Please specify a different voice.");
}

/* Allocates the resources for the voice.
*/
System.out.println("subashis");

helloVoice.allocate();

//helloVoice.setVolume(static_data.Instance().instance.volume);
//helloVoice.setRate(static_data.Instance().instance.voice_rate);
//helloVoice.setPitch(static_data.Instance().instance.pitch_rate);




helloVoice.speak(string);

//helloVoice.speak(string);

/* Clean up and leave.
*/
helloVoice.deallocate();

//JOptionPane.showMessageDialog(null,string);
} catch(Exception eee)
{
JOptionPane.showMessageDialog(null,eee.getMessage()+eee.getLocalizedMessage(),"sdfsd",JOptionPane.WARNING_MESSAGE);
}

}



public static void main(String args[])
{
new test1("HelloShuvo");
}

}



/////////////////////////////////////////////////////////////////////////////////////



When i compile this code,no error is found.

But when i execute this program there are some error found:


In the execution window the bellow information is found:


HelloShuvo Exception in thread "main" java.lang.NoClassDefFoundError: de/dfki/lt/
freetts/ConcatenativeVoice
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.sun.speech.freetts.en.us.cmu_time_awb.AlanVoiceDirectory.getVoice
s(AlanVoiceDirectory.java:24)
at com.sun.speech.freetts.VoiceManager.getVoices(VoiceManager.java:111)
at com.sun.speech.freetts.VoiceManager.getVoice(VoiceManager.java:519)
at test1.run(test1.java:34)
at test1.<init>(test1.java:22)
at test1.main(test1.java:75)
Caused by: java.lang.ClassNotFoundException: de.dfki.lt.freetts.ConcatenativeVoi
ce
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 18 more
Press any key to continue...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2009
Added on Aug 20 2008
12 comments
2,626 views