Results 1 to 9 of 9
  1. #1
    SM2010 is offline Member
    Join Date
    May 2010
    Posts
    14
    Rep Power
    0

    Default FreeTTS / speech.. only rendering Numbers??

    Is render the right word? do you render speech??

    anyway.. got a weird issue when trying out FreeTTS. Using a simple class I ripped from the web (code below), I eventually got this up and running (took a while to realise I needed to dump all the jars in my jre/lib folder), but it only seems to 'speak' when I put just numbers in the string (ie. "112245"). If I try "Hello", or any 'words', it doesn't error but doesn't say anything either!!

    Any ideas what I've done wrong??

    Also, if I try "1234567890", it actually says (in synth male voice)...

    "one two fourfivesixeight nine zero".

    Has anyone else run into these issues?

    thanks.

    Java Code:
    import javax.speech.*;
    import javax.speech.synthesis.*;
    import java.util.*;
    
    public class TellTime {
    
        public static void main(String[] args) {
    	try {
    		String sayTime = "1234567890";
    		
                             Synthesizer synth = Central.createSynthesizer(null);
    		synth.allocate();
    		synth.resume();
    			
    		synth.speakPlainText(sayTime,null);
    		
    		synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
    		synth.deallocate();
    			
    	} catch (Exception e) {
    		e.printStackTrace();
    	}
        }
    }

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default

    Quote Originally Posted by SM2010 View Post
    ...I eventually got this up and running (took a while to realise I needed to dump all the jars in my jre/lib folder)...
    That's not the way you do it.
    Dependencies (outside of the core JRE libraries) are referenced using the -cp switch for javac and java commands, or by setting the classpath in a batch file for running them. You don't dump jars into the jre lib, or set the system paths.

    As for your problem, have you tried running any of their demos locally? Like the Hello World one?

  3. #3
    SM2010 is offline Member
    Join Date
    May 2010
    Posts
    14
    Rep Power
    0

    Default

    ahh I see, bad practice. thanks for the pointer.

    No I haven't tried the demo's, good idea maybe the answers in there.

    Otherwise I'm pretty much restricted to writing a talking calculator.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default

    Which voice are you using? The "kevin" or "kevin16" voices should be capable to speak (more or less) random text ...

    kind regards,

    Jos

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default

    I might have to give this thing a try at some point...getting the PC to say random nonsense appeals to me.

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Tolls View Post
    I might have to give this thing a try at some point...getting the PC to say random nonsense appeals to me.
    Yes it's fun, as soon as it works; FreeTTS is a burden to install, especially because all those .jar files depend on each other; also the 'umbrola' (or whatever) voices don't seem to work on my installation ...

    kind regards,

    Jos

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default

    I might attempt it then, only to give up in frustration...a bit like most of my attempts at networking.

  8. #8
    SM2010 is offline Member
    Join Date
    May 2010
    Posts
    14
    Rep Power
    0

    Default

    JosAH - are you able to try my TellTime class I posted above, to see if yours will say anything apart from numbers?

    Tolls - if this is half as much fun as the speech tool on my old amiga 500 (25 years ago!), then all the pain of jars and classpaths and null pointers will almost be worth it!

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by SM2010 View Post
    JosAH - are you able to try my TellTime class I posted above, to see if yours will say anything apart from numbers?
    Yep, using the "kevin16" void I can make it say all sort of nonsense but I don't use that top level interface (API); I use the FreeTTS interface directy, i.e. instantiate a Voice and make it speak( ... )

    kind regards,

    Jos

Similar Threads

  1. FreeTTS MBROLA problem
    By Fillis52 in forum New To Java
    Replies: 1
    Last Post: 01-16-2011, 04:48 AM
  2. how to play text using freetts
    By kattavijay in forum Java Servlet
    Replies: 1
    Last Post: 03-19-2009, 08:49 AM
  3. Help with JTable rendering
    By daniel2008 in forum AWT / Swing
    Replies: 8
    Last Post: 01-18-2009, 03:51 AM
  4. JLabel Rendering
    By random4534 in forum New To Java
    Replies: 3
    Last Post: 12-16-2008, 08:55 AM
  5. printing two smallest numbers from a series of numbers
    By trofyscarz in forum New To Java
    Replies: 2
    Last Post: 10-14-2008, 11:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •