4 Replies Latest reply: Jul 12, 2012 5:26 AM by 948032 RSS

    How to take back resources from speech engine

    948032
      i make an application in swing in which i use jsapi text to speech which read and speak the selected file.
      but when synthesizer starts speaking it takes all resources back from jframe hence buttons not worked till speech completed thats why i am unable to use stop button .

      and if possible also give me detail how to read pdf's doc,.... files ..
      Thanx
        • 1. Re: How to take back resources from speech engine
          sabre150
          Sam_from_India wrote:
          i make an application in swing in which i use jsapi text to speech which read and speak the selected file.
          but when synthesizer starts speaking it takes all resources back from jframe hence buttons not worked till speech completed thats why i am unable to use stop button .
          You would appear to be running the text-to-speech in the Swing event thread. You need to run it in it's own thread - see http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html .

          >
          and if possible also give me detail how to read pdf's doc,.... files ..
          With what aim? i.e. what are you going to do with the content of the files?
          • 2. Re: How to take back resources from speech engine
            948032
            by freetts and jsapi i am reading files by io and spoken by jsapi and it worked . but when i select pdf or doc file java.io cant read doc or pdf normaly because these files are encoded hence unable to speak right ....
            • 3. Re: How to take back resources from speech engine
              sabre150
              Sam_from_India wrote:
              by freetts and jsapi i am reading files by io and spoken by jsapi and it worked . but when i select pdf or doc file java.io cant read doc or pdf normaly because these files are encoded hence unable to speak right ....
              There is no simple general method to extract the 'text' from all file types since most file types such as 'doc' files and 'pdf' files have markup that indicates how they should be formatted. For each different file type you will need to find a library that can read and interpret the file. PDF can be read using iText and 'doc' files can be read using Apache POI but in both there are limitations as to what they can accept.

              P.S. I have used FreeTTS for one project. Works great except when the text contains abbreviations or slang.
              • 4. Re: How to take back resources from speech engine
                948032
                Yes , same problem here ....... ? thanxxxxx