Tutorial on setting up freetts with maven
By: neztec Printer Friendly Format
I had similar problems setting everything up with all those path issues - especially since I was doing it through maven.
One thing to note, this was for setting up Sound Captcha for jcaptcha so my solution includes another dependency on "jcaptcha-extension-sound-freetts" and I can't get it to work without this jar (see below for pom dependencies).
To get this working I first got a copy of the FreeTTSHelloWorld source and played around with it in my webapp until I finally got it to run.
The only thing I had to do to the copied source code was add the freetts.voices at the beginning:
public static void main(String[] args) {
System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
Other than that, I turned to the demos and found that the demo depends on cmu_us_kal.jar and cmulex.jar so I installed those in my local repo:
mvn install:install-file -DgroupId=captcha-sound -DartifactId=kevin-voice -Dversion=1.0 -Dpackaging=jar -Dfile=cmu_us_kal.jar
mvn install:install-file -DgroupId=captcha-sound -DartifactId=lexicon -Dversion=1.0 -Dpackaging=jar -Dfile=cmulex.jar
Then finally added the following dependencies to my pom.xml:
<!-- Audio Captcha -->
<dependency>
<groupId>captcha-sound</groupId>
<artifactId>kevin-voice</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>captcha-sound</groupId>
<artifactId>lexicon</artifactId>
<version>1.0</version>
</dependency> <dependency>
<groupId>com.octo.captcha</groupId>
<artifactId>voice-en</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.octo.captcha</groupId>
<artifactId>jcaptcha-extension-sound-freetts</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Subscribe to Tutorials
Related Tutorials
Program using concept of byte long short and int in java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Archived Comments
1. ÙØØ´ Ø&se
View Tutorial By: Farbod Zarouri at 2015-11-17 10:25:42
2. کام&Ugrav
View Tutorial By: Farbod Zarouri at 2015-11-18 08:37:34
3. Michaelvot
View Tutorial By: Michaelvot at 2017-08-10 16:57:05