473,419 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Want to make Text to speech example ?

I am using following example but it give me null pointer exception. It is not created the object of synthesis .


import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;

public class HelloWorld {
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();
}
}
}

Can u help me to solve this ?
Aug 13 '10 #1
1 1564
Dheeraj Joshi
1,123 Expert 1GB
Please do not double post.

Regards
Dheeraj Joshi
Aug 13 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: zwylle | last post by:
Hi all, to avoid a nervous breakdown I finally decided to seek help :D I have a table defined with plain color background and in some cells I show pictures to frame my site. The problem I...
4
by: mitch-co2 | last post by:
What I am trying to do is when someone clicks on the YES radio button I want the text field called MYTEXT to equal the text field named DATE. The below code works as long as I do NOT UN-COMMENT...
4
by: UJ | last post by:
I have a client who wants me to make a web page with a marquee on it. No problem. They want the text to be easily changeable. No problem. They want it so that the text will appear about the...
3
by: MikeY | last post by:
Can anyhow direct me on how to make text trasnparent. The Text is loctated in my custom buttons. A Sample of my code is below. Font fn = new Font("Tahoma",8, System.Drawing.FontStyle.Bold); ...
2
by: Princess Kitty | last post by:
I'm new to Access. I am using Access 2003. I have a list box and a text box next to it. when a user clicks on the down arrow key and changes the list box i want the text box next to it to make the...
2
by: ICBM0926 | last post by:
Hi I am studying about copy constructor in C++.I changed a part of a text book example like follows: ======================================== #include <iostream> #include <cstring> using...
7
by: Richard Sherratt | last post by:
I'm trying to stop users deleting an existing value in a field. If they go to an existing record and hit delete, I want to give an error message and reverse the change. The BeforeUpdate event is...
1
by: maharajakecil | last post by:
hello all vb expert. i had develop a GUI using vb 6.0. did anybody know how to make text "your exceed limit. please reenter your value' when user enter the our of range value for X and Y. this is my...
3
by: chris52672 | last post by:
If I have text box 1 (Password Enter) and I have text box 2 (Password Reneter). After text has been entered in text box 1 and the enter key is pressed to make text box 2 active (the curser will...
1
by: wewannaknow | last post by:
I want a script that "types" my text letter by letter and also deletes the text letter by letter. I want it to look as if someone is typing the text live, and then when it deletes (letter by...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.