Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.sun.speech.freetts.*;
- import com.sun.speech.freetts.audio.*;
- import com.sun.speech.freetts.cart.*;
- import com.sun.speech.freetts.clunits.*;
- import com.sun.speech.freetts.diphone.*;
- import com.sun.speech.freetts.lexicon.*;
- import com.sun.speech.freetts.relp.*;
- import com.sun.speech.freetts.util.*;
- import de.dfki.lt.freetts.*;
- import de.dfki.lt.freetts.mbrola.*;
- public class a
- {
- VoiceManager freettsVM;
- Voice freettsVoice;
- public Voice voice;
- public a(String voiceName)
- {
- VoiceManager voiceManager = VoiceManager.getInstance();
- voice = voiceManager.getVoice(voiceName);
- }
- public void speak(String msg) {
- try {
- voice.allocate();
- voice.speak(msg);
- voice.deallocate();
- } catch (Exception e) {
- println("Speak failed");
- }
- }
- }
- void setup()
- {
- String speekstring = "Hello world. How are you today?";
- a speaker = new a("kevin16");
- speaker.speak(speekstring);
- }
- void draw()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement