1

this is my code

import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;   


public class FreeTTS {

 private static final String VOICENAME_kevin = "kevin";
 private String text; // string to speech

 public FreeTTS(String text) {
  this.text = text;
 }

 public void speak() {
  Voice voice;
  VoiceManager voiceManager = VoiceManager.getInstance();
  voice = voiceManager.getVoice(VOICENAME_kevin);
  voice.allocate();
  voice.speak(text);
 }

 public static void main(String[] args) {
  String text = "FreeTTS was written by the Sun Microsystems Laboratories "
    + "Speech Team and is based on CMU's Flite engine.";
  FreeTTS freeTTS = new FreeTTS(text);
  freeTTS.speak();
 }
}

it is givivng an error on "com.sun.speech" in imports,although i include lib folder from freetts into this project. Any kind of help would be appreciated.

user2113484
  • 41
  • 1
  • 2
  • 9

1 Answers1

0

I gone through your code it require freetts-1.0.jar just download it and then add this jar to your project classpath or create a newfolder in name it lib and then paste freetts-1.0.jar in that folder( i.e lib) and then add that jar.

Ashish
  • 1,943
  • 2
  • 14
  • 17
  • are you using netbeans? – Ashish Nov 23 '13 at 13:11
  • in eclipses go to your project file you will find option "library" there right click on that then click on "add JAR " then browse to it and find your project folder open that and then click on lib folder open that and you will find your jar file click on that file and click open and problem is solved – Ashish Nov 23 '13 at 13:17
  • what is that word "library" in your above comment. i couldnt find that. – user2113484 Nov 23 '13 at 13:22
  • 2
    in "eclipse" right click on your "project name" than select "built path" and select "add external Archives" than browse and find find your jar – Ashish Nov 23 '13 at 13:30