Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import com.sun.speech.freetts.*;
  2. import com.sun.speech.freetts.audio.*;
  3. import com.sun.speech.freetts.cart.*;
  4. import com.sun.speech.freetts.clunits.*;
  5. import com.sun.speech.freetts.diphone.*;
  6. import com.sun.speech.freetts.lexicon.*;
  7. import com.sun.speech.freetts.relp.*;
  8. import com.sun.speech.freetts.util.*;
  9. import de.dfki.lt.freetts.*;
  10. import de.dfki.lt.freetts.mbrola.*;
  11.  
  12. public class a
  13. {
  14. VoiceManager freettsVM;
  15. Voice freettsVoice;
  16. public Voice voice;
  17.  
  18. public a(String voiceName)
  19. {
  20. VoiceManager voiceManager = VoiceManager.getInstance();
  21. voice = voiceManager.getVoice(voiceName);
  22. }
  23.  
  24. public void speak(String msg) {
  25. try {
  26. voice.allocate();
  27. voice.speak(msg);
  28. voice.deallocate();
  29. } catch (Exception e) {
  30. println("Speak failed");
  31. }
  32. }
  33. }
  34.  
  35.  
  36. void setup()
  37. {
  38. String speekstring = "Hello world. How are you today?";
  39. a speaker = new a("kevin16");
  40. speaker.speak(speekstring);
  41. }
  42.  
  43.  
  44. void draw()
  45. {
  46.  
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement