Getting Started with MaryTTS: Your Step-by-Step Guide

Jan 17, 2024 | Programming

Welcome to the fascinating world of MaryTTS, a multilingual open-source text-to-speech platform that transforms text into lifelike speech. In this guide, we will walk you through the process of using MaryTTS effectively, whether you want to run it locally or integrate it into your own Java projects. Read on for a simplified explanation and some troubleshooting tips.

Running MaryTTS

Starting your MaryTTS server is as easy as baking a pie. Follow these simple steps:

  • Open your terminal and navigate to the MaryTTS folder.
  • Run the command: .gradlew run (or gradlew.bat run on Windows).
  • Your MaryTTS server will start, and you can access it in your web browser at http://localhost:59125.

If you need to start the server on a different address or port, use the following command:

sh.gradlew run -Dsocket.port=5920 -Dsocket.addr=0.0.0.0 --info

Remember, if you use 0.0.0.0 as the address, it listens on all interfaces. The options –info and –debug help you set the logging level for better debugging.

Downloading and Installing Voices

To enhance the speech capabilities of MaryTTS, you can download additional voices:

  • Run the command: .gradlew runInstallerGui.
  • This command opens an installer GUI for downloading and installing more voices.
  • Don’t forget to restart the running MaryTTS server to use the new voices.

Building MaryTTS

If you’re looking to build MaryTTS from the source, it’s simpler than you might think:

  • Run the command: .gradlew build.
  • This command compiles and tests all modules and prepares them for use under the build directory.

If you previously used version 5.x, refer to the 5.x branch for specific instructions.

Using MaryTTS in Your Own Java Projects

Integrating MaryTTS into your Java application? Think of it as inviting a celebrity to your party. You need to send a proper invitation:

For Maven, add the following to your pom.xml:


    
        maven-repository
        https://mlt.jfrog.io/artifactory/mlt-mvn-releases-local
    



    
        de.dfki.mary
        voice-cmu-slt-hsmm
        5.2.1
        
            
                com.twmacinta
                fast-md5
            
            
                gov.nist.math
                Jampack
            
        
    

]]>

And for Gradle, include this in your build.gradle file:

Synthesizing Speech

Synthesizing speech is like sending your message on a loudspeaker. You can do this straightforwardly through prepared HTTP queries. The examples for different setups like Python or Shell are proposed in the respective GitHub repositories.

Troubleshooting

Encountered issues? Here are some quick troubleshooting steps:

  • Make sure you have the correct permissions to run the scripts.
  • Check if the JAVA_HOME environment variable is set properly.
  • Restart your server after making changes to configurations or voices.

If you need further assistance, feel free to reach out to the MaryTTS community or check more resources. For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Extra Documentation

For configuration as a service on Linux or to extend dictionaries, refer to the guidelines provided within the MaryTTS documentation.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox