Results 1 to 4 of 4
- 05-24-2011, 03:29 PM #1
Newbies
- Join Date
- May 2011
- Posts
- 2
- Rep Power
- 0
text to speech conversioin using freeTTs
package ourproject;
import javax.speech.Central;
import javax.speech.synthesis.*;
import java.util.Locale;
public class SPeech {
public static void main(String args[]) {
try {
// Create a synthesizer for English
Synthesizer synth = Central.createSynthesizer(
new SynthesizerModeDesc(Locale.ENGLISH));
// Get it ready to speak
synth.allocate();
synth.resume();
// Speak the "Hello world" string
synth.speakPlainText("Hello, world!", null);
// Wait till speaking is done
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
// Clean up
synth.deallocate();
} catch (Exception e) {
e.printStackTrace();
}
}
}
-
- 05-24-2011, 03:50 PM #3
Newbies
- Join Date
- May 2011
- Posts
- 2
- Rep Power
- 0
I've got a very annoying problem. Basically whenever I compile the above code using javac and then try to run the CLASS file it generates, it tells me there's a null pointer exception on line 9 Synth.Allocate. I've searched all over the internet to no avail. The program is meant to speak Hello World to me. I've got Jsapi, all the jar files are in \jre6\lib\ext.
I've got speech.properties in both these locations, C:\Users\Myusername : C:\Program Files\Java\jre6\lib
I've searched the internet for hours and there are loads of posts about it, but none of them explain how to fix it. Please if you know how to fix it and get rid of this null pointer exception at line 9 could you tell me I would be so grateful!
Oh ye by the way I purposely put the spaces in the code to make it easier to read
- 05-24-2011, 04:58 PM #4
The API for Central saysit tells me there's a null pointer exception on line 9 Synth.Allocate.
Evidently synth is null.Returns:
a Synthesizer matching the required properties or null if none is available
This page has a step-by-step:I've searched the internet for hours and there are loads of posts about it, but none of them explain how to fix it.
Setup java speech jsapi using FreeTTS | Ryan-H.com
db
Similar Threads
-
Speech To Text
By jyothi.priyanka in forum Advanced JavaReplies: 1Last Post: 12-04-2011, 11:44 AM -
Text To Speech
By jyothi.priyanka in forum Advanced JavaReplies: 0Last Post: 02-24-2011, 05:00 PM -
FreeTTS / speech.. only rendering Numbers??
By SM2010 in forum New To JavaReplies: 8Last Post: 09-23-2010, 02:55 PM -
speech to text concersion
By ak88 in forum Advanced JavaReplies: 1Last Post: 03-09-2010, 08:57 AM -
how to play text using freetts
By kattavijay in forum Java ServletReplies: 1Last Post: 03-19-2009, 08:49 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks