last day (14 days later) » 

10:42
0
A: texttospeak.QUEUE_ADD constant is not working

RicardoYour call to tts.speak(result, TextToSpeech.QUEUE_ADD,null); is being done BEFORE the tts has been initialized. The QUEUE_ADD flag is there to handle simultaneous requests to speak AFTER it has been initialized. Suppose your tts is already speaking and you want it to speak something else. In tha...

but i am calling after initalising oninit method
No, you are not. When you call new TextToSpeech() you have no guarantees that the onInit() will be called immediately next. Your onCreate() method will very likely continue with the rest of its code all the way down to the tts.speak() call before the call back to the onInit().
then how to control that thing ........
One simple solution: On your onCreate(), add your text to speak to a global variable. When your onInit() is called, refer to this global variable to get the text to speak back.
I have declared it as global varibale only.
10:42
See my edit on the answer.
it will change the op only
What do you mean?
i have done that thing but is not working fine
Did you debug it?
yes
my tts is reciving text but it is not working
11-22 16:06:05.024: I/TTS received:(953): Welcome to Audio Bus , Please wait we are retriving information
11-22 16:09:31.514: I/System.out(982): ip : 10.184.211.143
11-22 16:09:31.584: I/System.out(982): 1 Welcome to Audio Bus , Please wait we are retriving information
11-22 16:09:31.624: E/log_tag(982): Error in http connectionjava.net.SocketException: Permission denied
11-22 16:09:31.624: E/log_tag(982): Error converting result java.lang.NullPointerException
11-22 16:09:31.624: I/TTS received:(982): something is happen please try again
my log cat file is here
10:48
That's a problem with your other part of the code. Look at the error code and line.
It's related to your http request
You don't have permission on the url you are passing
but in the catch i have changed some thing
then also it is not working
see what i have changed
where?
//http post
try{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://"+IP+"/checkingbusno.php");
List<BasicNameValuePair> nameValuePairs = new ArrayList<BasicNameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("BusStopName", "thakur_complex"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}catch(Exception e){
Log.e("log_tag", "Error in http connection"+e.toString());
i had posted here
and what is the error now?
that's the same
it is not speaking second time
10:53
What is your logcat now? same as above?
to test your tts, do the following. Remove all the http request part
just set speakText = "test"; somewhere.
You will see your problem is in getting the data from the url. You need to debug that later and find out where is the problem.
Then try posting another question related to getting data from the web.
good luck!

last day (14 days later) »