1

I am using freetts jar file for text to speech. But I need much more voices like Indian English.

There my code is:

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

 class s
 {

     VoiceManager freettsVM;
     Voice freettsVoice;
     private Voice voice;
     public s(String voiceName) 
     {
          VoiceManager voiceManager = VoiceManager.getInstance();
           voice = voiceManager.getVoice(voiceName);
      }
      public void speak(String msg) {
          freettsVoice.allocate();
          freettsVoice.speak(msg);
          freettsVoice.deallocate();
      }
 }
 public class Main {
    public static void main(String[] args) {
    String speekstring = txtmassage.getText();
            s t = new s("kevin16");
            t.speak(speekstring);}
 }

It’s work correctly, but I need more voices.

now i changed my code into enter image description here

then there error is

 Could not validate any MBROLA voices at

  C:/Users/anand/Documents/NetBeansProjects/mbrola

  Make sure you FULLY specify the path to
  the MBROLA directory using the mbrola.base
  system property.

  Exception in thread "main" java.lang.NullPointerException
          at newpro.TestTTS.<init>(TestTTS.java:20)
         at newpro.TestTTS.main(TestTTS.java:29)
  Java Result: 1
  BUILD SUCCESSFUL (total time: 0 seconds)
anand
  • 43
  • 1
  • 4

1 Answers1

0

You could use the MBROLA - Project. It's free and offers several languages.

You will need to download the project-package itself and the voices.

For a step-by-step guide on how to install and use MBROLA you can go to here:

https://stackoverflow.com/a/26236563/1368690

Or go to the project page itself:

http://tcts.fpms.ac.be/synthesis/mbrola.html

When you scroll down a bit, there a lots of voice you can test and see, if they will be usefull for you.

Community
  • 1
  • 1
hamena314
  • 2,969
  • 5
  • 30
  • 57
  • @anand: 2 things - 1) a "please" would be nice. ;) ... 2) by using google on the error message I've found this: http://stackoverflow.com/questions/13810052/freetts-mbrola-not-able-to-find-path ... this should help MBROLA to find the paths and therefore validate it. – hamena314 Jan 14 '16 at 08:20