import java.util.Scanner;

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

public class TextToSpeech {
public static void main(String args[]){

Scanner input = new Scanner(System.in);
String userInput = input.nextLine();

if(userInput == "hi"){
Voice v;
VoiceManager vm=VoiceManager.getInstance();
v=vm.getVoice("kutlo1");
v.allocate();
v.speak("Hey my name is kutlo");
input.close();
}else
System.out.println("you suck try again");
}

}

Recommended Answers

so learn to use BlueJ, or better yet learn Java and ditch that POS excuse for an IDE.
You might want to pick up a better IDE at some point, but learn to use that.
Your "problem" has nothing to do with Java, and everything with you not reading the …

Jump to Post

All 2 Replies

im using dr java and bluej

so learn to use BlueJ, or better yet learn Java and ditch that POS excuse for an IDE.
You might want to pick up a better IDE at some point, but learn to use that.
Your "problem" has nothing to do with Java, and everything with you not reading the documentation of your tools.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.