Sam_from_India wrote: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 .
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 ..With what aim? i.e. what are you going to do with the content of the files?
Sam_from_India wrote: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.
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 ....