This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Unable to play sounds using FreeTTS  RSS feed

 
Ranch Hand
Posts: 130
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am trying to execute the fallowing code.
If i execute the code as a normal java application (using main method) its working fine.


But when i am calling this code from a servlet which is deployed in Tomcat6


getting exception

.
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, you're trying to make a server make sounds? Who could possibly hear those?
 
Bartender
Posts: 20766
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Ulf means is that this is code that's designed to output speech from the audio hardware of some server locked in a room in a datacenter somewhere and the server probably doesn't even have loudspeakers attached to it.

In order for a web application to be able to produce synthesized speech that can be heard by the web user, the generated audio needs to be piped to the web user's (client) computer, where the user's audio hardware can play it. Assuming that THEY have attached loudspeakers (or at least something like headphones).

Since web HTTP protocols don't support that, what you're going to need to do is basically the same thing you'd do if the web application was generating PDF's or graphics - create a temporary file with the data in it and attach it to a URL that the client would then request in order to get the audio data and play it.

There should be options for TTS output in wav, ogg, and/or mp3 formats (among others), so you need to read up on that part of the package.
 
I love a good mentalist. And so does this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!