[Tasker Tips & Tricks] CrashOverride93:
Hi to all XDA users!

I'm working on a project that makes easier the task of synthesizing plain text into speech on our Android devices. In short, what it does is speech out the copied (selected) text what we want to hear, reacting (enabling tts profile) to a specific event like mobile shaking, and to a specific context as staying on an app that contains the text. Since we select a text until we hear it, will be necessary to follow just 2 previous simple steps. All visual and interactive for the user.

I decided to create it because for me is too hard copy the text I want, leave the app that contains it, search and open the tts app. (some apps allow you to copy and paste the text to proccess), and press the play button. So I wanted to make it easier and faster. I hope you find it useful! ;)

PROFILES

(x1)

[COLOR="Blue"]TTS Synthesizing[/COLOR]
[U]State[/U]: Display State [ Is : On ]
[U]Event[/U]: Shake [ Axis:Left-Right Sensitivity:Medium Duration:Medium ]
[U]Application[/U]: Firefox...

TASKS

(x1)

[COLOR="Blue"]Clipboard Text[/COLOR]
[U]A1[/U]: Flash [ Text:<<Nothing copied to clipboard>> Long : On ] If [ %CLIP ~ %* ]
[U]A2[/U]: Show Scene [ Name:Reading (1) Display As : Overlay, Blocking Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button : Off Continue Task Immediately : Off ] If [ %CLIP !~ %* ]

SCENES

(x4)

[B]Reading (1)[/B]
-----------------------------------------------
[COLOR="Blue"]Accept Button[/COLOR]
[U]A1[/U]: Variable Set [ Name:%SSpeed To:3 Do Maths : Off Append : Off ]
[U]A2[/U]: Destroy Scene [ Name:Reading (1) ]
[U]A3[/U]: Show Scene [ Name:Reading (2) Display As : Overlay, Blocking Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button : Off Continue Task Immediately : On ]

[COLOR="Blue"]Cancel Button[/COLOR]
[U]A1[/U]: Destroy Scene [ Name:Reading (1) ]

[B]Reading (2)[/B]
-----------------------------------------------
[COLOR="Blue"]English Button[/COLOR]
[U]A1[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h2.wav Pitch:5 Speed:7 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A2[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h1.wav Pitch:5 Speed:6 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A3[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng.wav Pitch:5 Speed:5 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A4[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l1.wav Pitch:5 Speed:4 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A5[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l2.wav Pitch:5 Speed:3 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A6[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l3.wav Pitch:5 Speed:2 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 6 ]
[U]A7[/U]: Flash [ Text:Processed file! Long : Off ]
[U]A8[/U]: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
[U]A9[/U]: Destroy Scene [ Name:Reading (2) ]
[U]A10[/U]: Show Scene [ Name:Reading (3) Display As : Overlay, Blocking Horizontal Position:100 Vertical Position:24 Animation:System Show Exit Button : Off Continue Task Immediately : On ]

[COLOR="Blue"]Spanish Button[/COLOR]
[U]A1[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h2.wav Pitch:5 Speed:7 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A2[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h1.wav Pitch:5 Speed:6 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A3[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa.wav Pitch:5 Speed:5 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A4[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l1.wav Pitch:5 Speed:4 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A5[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l2.wav Pitch:5 Speed:3 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A6[/U]: Say To File [ Text:%CLIP Engine:Voice:default:default File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l3.wav Pitch:5 Speed:2 Continue Task Immediately : Off Continue Task After Error : On ] If [ %SSpeed = 6 ]
[U]A7[/U]: Flash [ Text:Processed file! Long : Off ]
[U]A8[/U]: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
[U]A9[/U]: Destroy Scene [ Name:Reading (2) ]
[U]A10[/U]: Show Scene [ Name:Reading (3) Display As : Overlay, Blocking Horizontal Position:100 Vertical Position:24 Animation:System Show Exit Button : Off Continue Task Immediately : On ]

[COLOR="Blue"]Language Spinner[/COLOR]
[U]A(s)[/U]: Variable Set [ Name:%SSpeed To:1/2/3/4/5/6 Do Maths : Off Append : Off ] = ITEMS

[COLOR="Blue"]Close Button[/COLOR]
[U]A1[/U]: Variable Clear [ Name:%SSpeed Pattern Matching : Off ]
[U]A2[/U]: Destroy Scene [ Name:Reading (2) ]

[B]Reading (3)[/B]
-----------------------------------------------
[COLOR="Blue"]Play Button[/COLOR]
[U]A1[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h2.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A2[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h2.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A3[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h1.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A4[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h1.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A5[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A6[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A7[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l1.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A8[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l1.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A9[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l2.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A10[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l2.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A11[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l3.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 6 ]
[U]A12[/U]: Music Play [ File:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l3.wav Start:0 Loop : Off Stream:3 Continue Task After Error : On ] If [ %SSpeed = 6 ]

[COLOR="Blue"]Back Button[/COLOR]
[U]A1[/U]: Music Back [ Jump:4 ]

[COLOR="Blue"]Stop Button[/COLOR]
[U]A1[/U]: Music Stop [ Clear Dir : Off ]

[COLOR="Blue"]Save Button[/COLOR] (tap)
[U]A1[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h2.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A2[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h2.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A3[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h1.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A4[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h1.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A5[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A6[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A7[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l1.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A8[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l1.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A9[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l2.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A10[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l2.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A11[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l3.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 6 ]
[U]A12[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l3.wav To:/sdcard/Download Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 6 ]
[U]A13[/U]: Flash [ Text:Audio file (WAV) saved! Long : On ]

[COLOR="Blue"]Save Button[/COLOR] (long tap)
[U]A1[/U]: Run Shell [ Command:find /sdcard/Tasker/Files/TTS/audiotemp/*.wav Timeout (Seconds):0 Use Root : Off Store Output In:%FileName Store Errors In: Store Result In: ]
[U]A2[/U]: Variable Section [ Name:%FileName From:36 Length:13 Adapt To Fit : Off Store Result In:%FileName ] If [ %SSpeed = 3 ]
[U]A3[/U]: Variable Section [ Name:%FileName From:36 Length:16 Adapt To Fit : Off Store Result In:%FileName ] If [ %SSpeed != 3 ]
[U]A4[/U]: Show Scene [ Name:Reading (4) Display As:Dialog Horizontal Position:100 Vertical Position:94 Animation:System Show Exit Button : Off Continue Task Immediately : Off ]

[COLOR="Blue"]Close Button[/COLOR]
A1: Run Shell [ Command:cd /sdcard/Tasker/Files/TTS/audiotemp && rm -r * .* Timeout (Seconds):0 Use Root : Off Store Output In: Store Errors In: Store Result In: Continue Task After Error : On ]
A2: Variable Clear [ Name:%FileName Pattern Matching : Off ]
A3: Variable Clear [ Name:%SSpeed Pattern Matching : Off ]
A4: Destroy Scene [ Name:Reading (3) ]

[B]Reading (4)[/B]
-----------------------------------------------
[COLOR="Blue"]Accept Button[/COLOR]
[U]A1[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h2.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A2[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h2.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 1 ]
[U]A3[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_h1.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A4[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_h1.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 2 ]
[U]A5[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A6[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 3 ]
[U]A7[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l1.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A8[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l1.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 4 ]
[U]A9[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l2.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A10[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l2.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 5 ]
[U]A11[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_eng_l3.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 6 ]
[U]A12[/U]: Copy File [ From:/sdcard/Tasker/Files/TTS/audiotemp/audiofile_spa_l3.wav To:/sdcard/Download/%FileName.wav Use Root : Off Continue Task After Error : On ] If [ %SSpeed = 6 ]
[U]A13[/U]: Destroy Scene [ Name:Reading (4) ]
[U]A14[/U]: Flash [ Text:Audio file (WAV) saved! Long : On ]

[COLOR="Blue"]EditText Element[/COLOR]
[U]A1[/U]: Variable Set [ Name:%FileName To:%new_val Do Maths : Off Append : Off ]

[COLOR="Blue"]Close Button[/COLOR]
[U]A1[/U]: Destroy Scene [ Name:Reading (4) ]

SCREENSHOTS

DEMOSTRATION

[YOUTUBE]Q9Dwpz-NqvM[/YOUTUBE]

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _​

ABOUT THE PROJECT

· There are available two ways by you can import the project (profiles, tasks, scenes). One is by just importing it using the file on "projects" folder, it will import the whole project at once; the other, by importing it "part-by-part". The 'Files' folder (if included) have to be ALWAYS copied to Tasker directory.

· All scenes are adjusted to work on 1280x720 device (LG K10). You'll have to resize them to fit it on you

· The 'audiotemp' folder is used to temporally store the .WAV audio file that Tasker generates during the execution of the task.

· Why I decided to generate and work with a .wav file but I could do all of this with the native tts function of tasker (real-time)? = Primary, because I noticed a little delay on the tts service proccess on my phone (I imagine that could appear on other phones), causing a delayed playback. And by the other hand, if we manage to add the feature to be able to pause the playback, will be neccessary to work with a file because the TTS, as I know, can't do that itself.

· You have available more country flags icons than just English and Spanish from this project. Download them from the 'International Flags (icons).rar' attached file on this thread. Will be neccessary Photoshop or whatever program you like to use them into Tasker.

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _​

My Tasker PROJECTS & TASKS

--> [PROJECT] Anti-Theft System

--> [PROJECT] Automate all your backup tasks

--> [PROJECT] Call Recorder

--> [PROJECT] High temperature warning device

--> [TASK] Auto-Switch Keyboard(s)

--> [TASK] Talking Clock

Tasker Chat Groups

--> Tasker on WhatsApp

--> Tasker on Telegram

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

If you liked the project. . .

. . . and you decide to invite me to a coffee, I would be very greatful to you ;P

Account

: ceedcv@outlook.com