Is it possible for macrodroid to do this?

Darkskysz

New member
So I want to automate an app with inbuilt text to speech, below are the steps

Step 1 swipe up from the bottom to make the buttons available
Step 2 tap on TTS(text to speech) button
Step 3 tap "play on the TTS interface"
Step 4 after TTS is done reading the entire page swipe left and repeat infinitely



Is that possible to do?
 

Attachments

  • Screenshot_20211012-212556046 (1).jpg
    Screenshot_20211012-212556046 (1).jpg
    531.9 KB · Views: 8

420

Active member
I think it might just be, for the first 3 steps you should be able to use the "UI interaction" action and for step 4 you could possibly use the "wait untill - Music/Sound (stopped) playing" action to wait for TTS to finish followed by another "UI interaction" action for the swipe.

Ps; (incase you are not familiar with macrodroid) i would advise you to NOT put things in an infinite loop untill after everything else is working and you have added some reliable constraints to exit/not invoke this infinite loop when needed, an infinite loop can be very annoying to get stuck in :p
 

tanutanu

Active member
So I want to automate an app with inbuilt text to speech, below are the steps

Step 1 swipe up from the bottom to make the buttons available
Step 2 tap on TTS(text to speech) button
Step 3 tap "play on the TTS interface"
Step 4 after TTS is done reading the entire page swipe left and repeat infinitely



Is that possible to do?
You might do it with TouchTask or Autovoice/AutoInput plugins. On my device, detecting swipe is not working though.
 
Last edited:
  • Love
Reactions: 420

Darkskysz

New member
I think it might just be, for the first 3 steps you should be able to use the "UI interaction" action and for step 4 you could possibly use the "wait untill - Music/Sound (stopped) playing" action to wait for TTS to finish followed by another "UI interaction" action for the swipe.

Ps; (incase you are not familiar with macrodroid) i would advise you to NOT put things in an infinite loop untill after everything else is working and you have added some reliable constraints to exit/not invoke this infinite loop when needed, an infinite loop can be very annoying to get stuck in :p
Hi thanks I found this helpful

I was about to give up cuz it was confusing at first, but i got it to work

only problem is the 4th step "wait until Music/Sound stopped playing" doesn't work once TTS stops playing.

any suggestions? Was i supposed to install some kind of plugin? Or something i missed?
 

420

Active member
Hi thanks I found this helpful

I was about to give up cuz it was confusing at first, but i got it to work

only problem is the 4th step "wait until Music/Sound stopped playing" doesn't work once TTS stops playing.

any suggestions? Was i supposed to install some kind of plugin? Or something i missed?
That was why i said "it might just be possible" and "you could possibly use" :p Apparantly macrodroid does not consider your TTS speaking as music or sound playing.. This is probably because it simply uses another audio stream, maybe there is a way to change which audio stream it uses?

I really can't think of another way to determine that TTS has finished speaking.. (there is no plugin involved btw and you did not miss anything ;))
 

Darkskysz

New member
That was why i said "it might just be possible" and "you could possibly use" :p Apparantly macrodroid does not consider your TTS speaking as music or sound playing.. This is probably because it simply uses another audio stream, maybe there is a way to change which audio stream it uses?

I really can't think of another way to determine that TTS has finished speaking.. (there is no plugin involved btw and you did not miss anything ;))
One last question how do I loop the macro? I cant seem to find it.

Edit: nvm i found it thanks for the help

even if it can't operate completely on its own I can still use it with triggers this will have to do for now v: its better then nothing
 
  • Like
Reactions: 420

420

Active member
One last question how do I loop the macro? I cant seem to find it.

Edit: nvm i found it thanks for the help

even if it can't operate completely on its own I can still use it with triggers this will have to do for now v: its better then nothing
Something else just came to my mind, if the pages are of (somewhat) equal lenght you could use a fixed wait time, this may mean that there will be a delay on the "shorter" pages before it goes to the next one but atleast it will be automated..
 

tanutanu

Active member
Hi thanks I found this helpful

I was about to give up cuz it was confusing at first, but i got it to work

only problem is the 4th step "wait until Music/Sound stopped playing" doesn't work once TTS stops playing.

any suggestions? Was i supposed to install some kind of plugin? Or something i missed?
I don't think you have to detect stopping the TTS steam. When you swipe left(I can't detect it but can tapping screen, pressing button or another input), you can stop the TTS sound immediately, just requesting another TTS with ' '(single white space). It means very short silent sound. When previously running MD TTS action is calling with "wait to complete before..." option but without "queue text if...", it is effective.
 

420

Active member
I don't think you have to detect stopping the TTS steam. When you swipe left(I can't detect it but can tapping screen, pressing button or another input), you can stop the TTS sound immediately, just requesting another TTS with ' '(single white space). It means very short silent sound. When previously running MD TTS action is calling with "wait to complete before..." option but without "queue text if...", it is effective.
I don't think he is talking about macrodroid's TTS but one that is build into some other app (see the screenshot in his first post), and it does have to detect that it has stopped else it does not know that it has finished reading the page and should do that swipe left in the first place. :p

Maybe it is an option for him to use macrodroid TTS instead but there will need to be a way for him to get the text that he wants spoken into macrodroid, if it is a text file then it could be possible, else i do not know..

Ps; i think you are misunderstanding him, he doesn't want to use a swipe or any other screen touch as a trigger, he just wanted to swipe as an action.
 

420

Active member
I just found out TouchTask plugin (so maybe a plugin is the way to go after all :p) has an action to get the text content from the screen (this obviously requires you to give TouchTask permission to read your entire screen, and there are no guarantees that it works with your text displaying app) so you could try that and then have macrodroid read it using the speak text action, it has an option to wait untill finished which is just what you need, it also requires less UI interactions (step 1-3 are no longer needed) making it more reliable.
 

tanutanu

Active member
I don't think he is talking about macrodroid's TTS but one that is build into some other app (see the screenshot in his first post), and it does have to detect that it has stopped else it does not know that it has finished reading the page and should do that swipe left in the first place. :p

Maybe it is an option for him to use macrodroid TTS instead but there will need to be a way for him to get the text that he wants spoken into macrodroid, if it is a text file then it could be possible, else i do not know..

Ps; i think you are misunderstanding him, he doesn't want to use a swipe or any other screen touch as a trigger, he just wanted to swipe as an action.
Don't worry, probably I caught what OP meant this time:) I often miss it though:ROFLMAO:
In my way, getting entire text once as MD variable and then passing them to TTS via MD action. As I wrote on #4, any text on another app can scan through these plugins even if rendered image via their internal OCR. If OP is familiar to manipulate text string, I recommend to import the text once. It makes the post processing flexible and easier.

I imagined the following use case:
1. open ebook app,
2. read text by TTS automatically(repeat it infinity),
3. go next pege and restart reading when swipe left.
At this moment, If the speaking TTS stops immediately and OP can move to next page without blocking his interaction, the reading experience might be better. That's my thought.

Thanks for your follow up:)
 
  • Like
Reactions: 420

tanutanu

Active member
I just found out TouchTask plugin (so maybe a plugin is the way to go after all :p) has an action to get the text content from the screen (this obviously requires you to give TouchTask permission to read your entire screen, and there are no guarantees that it works with your text displaying app) so you could try that and then have macrodroid read it using the speak text action, it has an option to wait untill finished which is just what you need, it also requires less UI interactions (step 1-3 are no longer needed) making it more reliable.
So my idea is that using "swipe left" action as the trigger to interrupt continuous speach sound and to go. The queued text might reduce the quality of UX.

EDITED: One more thing.
Any sound on the same channel has possibility to be interrupted before it queued in the lower level sound buffer. Basically most media devices has some stages of buffers, so I'm not sure how quickly it can. However, I remember I could override with ' ' immediately when I tested a MD macro as the options I wrote.
 
Last edited:
  • Like
Reactions: 420

Jacob L

Moderator
There are broadcast intents that fire when TTS starts and finishes speaking. Look at the macro called New triggers by Lawsonator to find them and 100s of other triggers
 

tanutanu

Active member
There are broadcast intents that fire when TTS starts and finishes speaking. Look at the macro called New triggers by Lawsonator to find them and 100s of other triggers
The broadcast intent tells only the fact that a text in TTS queue is proceeded. it has no additional info such as which app/macro send it and/or it is completely finished or not unfortunately. However, Android is a personal device and it is controllable in most cases because it tend to be displayed on the foreground window fortunately:) We need to handle it carefully when it as a progress hint. It depends on the targets use cases.
 

Jacob L

Moderator
Try this: wait to complete before running next action on the TTS, you can use a variable of wait until trigger variable change if you still need to check
 

Darkskysz

New member
I just found out TouchTask plugin (so maybe a plugin is the way to go after all :p) has an action to get the text content from the screen (this obviously requires you to give TouchTask permission to read your entire screen, and there are no guarantees that it works with your text displaying app) so you could try that and then have macrodroid read it using the speak text action, it has an option to wait untill finished which is just what you need, it also requires less UI interactions (step 1-3 are no longer needed) making it more reliable.
This ends up breaking my macro in macrodroid the gesture that would work stopped working even tho it had nothing to do with the gesture task within the macro
 

Darkskysz

New member
There are broadcast intents that fire when TTS starts and finishes speaking. Look at the macro called New triggers by Lawsonator to find them and 100s of other triggers
This gave me an idea but how do i detect the TTS as a service/package I dont know what its being processed as

btw there was a small miscommunication error the TTS I'm using is the phone built in TTS which is under accessibility "select to speak" the google text to speech/ that comes with any android phone i supposed...
 

420

Active member
This ends up breaking my macro in macrodroid the gesture that would work stopped working even tho it had nothing to do with the gesture task within the macro
Well yeah it's almost a completely different setup, which gesture that was working has stopped? the one from step 4?

I need more information to tell you anything really :p Did you succesfully add the TouchTask plugin read screen action? is that part working and saving your text to a variable? And also succesfully reading it? A screenshot of your macro would also help.
 
Top