2

Recently I've found a way to make Text To Speech in Java (MaryTTS:http://mary.dfki.de/index.html)

I've found this code to use it in Java:

public class MaryTTSRemote
{
    private MaryInterface marytts;
    private AudioPlayer ap;

    public MaryTTSRemote(String voiceName)
    {
        try
        {
            marytts = new LocalMaryInterface();
            marytts.setVoice(voiceName);
            ap = new AudioPlayer();
        }
        catch (MaryConfigurationException ex)
        {
            ex.printStackTrace();
        }
    }

    public void say(String input)
    {
        try
        {
            AudioInputStream audio = marytts.generateAudio(input);

            ap.setAudio(audio);
            ap.start();
        }
        catch (SynthesisException ex)
        {
            System.err.println("Error saying phrase.");
        }
    }
}

But when I try to run this class I don't know what name the basic voice has. Does someone know what string I have to give this class to get it working?

JetStream
  • 809
  • 1
  • 8
  • 28

1 Answers1

3

You can get the list of available voices by calling

marytts.modules.synthesis.Voice.getAvailableVoices()

Here is the source code for more information.

Alexander Solovets
  • 2,447
  • 15
  • 22
  • Alexander is there any change to know how we can apply effects to the voice?I can't find very clear documentation for that.It is like jungle the `MaryTTS` project... :) – GOXR3PLUS Oct 19 '16 at 14:25
  • Actually i posted a question here: http://stackoverflow.com/questions/33321422/marytts-voice-name – GOXR3PLUS Oct 19 '16 at 14:33