Text To Speech Extension for Android
Version 0.2
Platforms : All android from version 2.3
Close future : no others.
Far far far far future : who knows maybe IOS windows and Linux ?
Future Planned ImprovementsClose Future :
- block to get installed engines working
-
if possible, event to trigger when text said - chose engine to start ( you could use real engines that accept SSML)
- create sound file from TTS
(easy) Combine the say text add and add to playlist into one block - earcons for android > 5.0
- remove useless imports
remove useless trace, print
Log
- combined multiple blocks
- trigger event when TTS has finished processed sentence
Feedback neededIf somebody has an Android >= 5.0 Lollipop, I'm super interested to see if it works
and would love to make a special test
which I'll explain later
On earcpns, if somebody is able to make it work.
Advice welcomed !!On the code, colour blocks, blocks names ....
If somebody knows why onActivityResult doesn't work ....
Special ThanksTo Justin, for his help with complex ( for me) code
To Mdotedot, for his help in testing and reading my posts.
How to use it You have to start engine or set language.
After about 2 seconds, you can begin to use the engine. ( so put the say text block into a after 2 seconds block, if you use it directly after starting the engine).
Non BlocksWhen TTS has finished playing text, set game attribute
TTSLastSaidText to last said text
and trigger event in scene
TTSHasFinishedPlayingBlocks :Action Blocks
1 sayText Flush/Queueinput : String
The speech engine will say the text.
Flush : instantly
Queue : will put the text in the queue
4 setLanguageLocale to .. or .. orinput: You can choose variant or language or type the id of the locale
It will check if the used TTS engine has the locale which begins with the letters written. For example for French, you can type French, Fr, F. If you want to have a specific French you'll have to type Fr-CA. If FR_CA isn't proposed , it will use Fr. If Fr isn't installed , it will propose to install it . It takes about 2 seconds.
It will restart engine.
5 setPitchinput : float
Normal pitch is 1.
6 setSpeechRateinput : float
Normal pitch is 1
10 Close EngineCloses engine. Saves memory.
11 Stop Engine
Normally to stop engine and flush queue. ( But you just use say text with an empty string) But whenever I use it I cannot say anything afterwards.
12 Map string of text ... sound path …input : String .. String ( <--a path)
For now, only in Android before Lollipop 5
You must use Add earcon to play it.
Should work, but I have no idea how to use it, if somebody knows.
13 Add earcon to playlist …input : String
Adds earcon to playlist.
For now, only in Android before Lollipop 5
Should work, but I have no idea how to use it, if somebody knows.
Normal Blocks
7 isSpeakingoutput : boolean
8 getLangAvailable id/namesTakes One Second. Returns or the ids or the display names of the languages available on the engine. Engine must be started to use.
output : List
3 Installed enginesReturns installed engines
output: trace for now
Download LinkDownload attached ( only member of forum can see)