Android Tutorial Android Text To Speech example

Status
Not open for further replies.

jmeuse2

Member
Licensed User
Can you revert the speech back to text to help solve format disarrangement in text reflow?

Sent from my SAMSUNG-SGH-I847 using Tapatalk 2
 

Erel

Administrator
Staff member
Licensed User
There is no simple way to do it. You can try to record the audio and then play it with the voice recognition is active.
 

Shadow&Max

Active Member
Licensed User
I've got TTS working in some places in my app, but in the startup, I can never get the TTS1_Ready sub to fire on initialize. It simply executes the line and goes to the next, but it's NOT initializing there. My TTS is TTS1, the sub is TTS1_Ready, the call to it is TTS1.Initialize("TTS1"), and yet it never gets to the TTS1_Ready sub... what could possibly be wrong? I know that in this sequence, it's not being initialized anywhere else first... But I need this to work and for the life of me, I can't seem to get it to trigger.

FYI, I've closed the Genymotion emulator and started from scratch, and it still doesn't fire...

OK, I'm going to modify this a bit... I used another device from Geny, and it triggered there. Is this completely device dependent?

More... I put a messagebox in the sub to see if and when it fires, and it doesn't fire as expected. I put a breakpoint by the TTS1.Initialize("TTS1") statement... As I step through, it obviously executes that line, then goes on with the program... LATER, it hits that _Ready proc... But at a very unexpected time, and not when anything to do with Text To Speech is happening.

Any suggestions would be greatly appreciated...
 
Last edited:

Erel

Administrator
Staff member
Licensed User
As I step through, it obviously executes that line, then goes on with the program... LATER, it hits that _Ready proc... But at a very unexpected time, and not when anything to do with Text To Speech is happening.
This is the expected behavior.

It prepares the text to speech service in the background and fires the Ready event when it is ready.
 

Shadow&Max

Active Member
Licensed User
How long should you have to wait to be able to use it Erel? If I initialize it and need to use it, is there any way to know how long it will be before I can actually have it speak? To be clear, I should do everything I want to do if it's automatically running through a list, reading items, in the Ready sub?
 

Erel

Administrator
Staff member
Licensed User
The event is raised when it is ready. Usually it happens in a few seconds. There is no more information available...

You should not call Speak before the Ready event.
 

Erel

Administrator
Staff member
Licensed User
You will need to install a speech engine that supports Hebrew.
 

EvgenyB4A

Active Member
Licensed User
I have installed Ron Hebrew TTS on my phone, added 'he'' on language spinner at TTS code example, but after selecting "he" I get toastmessage " Language data not found"
 

Erel

Administrator
Staff member
Licensed User
Have you set it to be the default speech engine (under Settings - Language)?
 

EvgenyB4A

Active Member
Licensed User
Have you set it to be the default speech engine (under Settings - Language)?
I changed TTS engine in Settings->Language-->Speech->TTS parameters to Ron Hebrew and now the TTS example can speak Hebrew(only) in trial version.
Thank you very much first of all.
The next question is how to change TTS engines by B4A?
 

AndyW999

Member
Licensed User
Can TTS be used from a service module to speak an announcement instead of a ring tone when the device is 'asleep'?

Thought I would ask before trying it ;)

Thanks

Andy.
 

Erel

Administrator
Staff member
Licensed User
Yes. It should be possible. Use PhoneWakeState to keep the CPU running until TTS completes.
 

pmsmc

Member
Licensed User
Hi Erel,
I am developing a application that uses both TTS and Voice recognition.
when I ask a user for and answer, using TTS, and then use VR to catch the user responde, every time I get back to TSS I get an error, saying that the Speech engine is not ready, but i have never released it form memory.
Also, is there a way to send a string to TTS and only continue the application after the TextToSpeechFinish event ?

Best Regards,
Pedro
 
Status
Not open for further replies.
Top