Android Question [RESOLVED] TTS Code won't compile "Input string was not in a correct format."

SimonInCanada

Member
Licensed User
Hi

The original TTS Example compiles and runs okay using TTS V1.0. When I try to include TTS in my own app using the example as a model, I get the compiler error "Input string was not in a correct format." on the line where I call TSS1.Speak; e.g.
Dim S as String
S = "Welcome!"
TSS1.Speak(S, True)

That is the ONLY error information and I don't know what it means. I tried, as in the example, adding an EditText view and setting similar properties to the example then some text, then feeding this to TSS1.Speak like the example does but this gives the same error.
 

JohnC

Expert
Licensed User
Longtime User
In the sample you uploaded:
B4X:
TTS1.Speak(EditText1.Text , True);
You have a trailing semi-colon ( ; ) at the end of the line - just remove it and it should work.

I'm guessing the trailing semicolon is a force of habit from java
 
Upvote 0

SimonInCanada

Member
Licensed User
You are quite right about the semicolon. What a clot!

Actually, in this case this project consists of two embedded devices programmed in C, plus this app in B4A.

Thanks again and sorry for wasting everybody's time!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…