Problem with Speak Text action

hendis

Member
Hi, everyone - thanks in advance to anyone that has any ideas or fixes for this. It's a bewildering problem...

I have 83 macros in MD 5.38.16 Pro on a T-Mobile REVVL V+ 5G running Android 12.

I set up a macro to remind me to pick up my mail on my way home from work. Strangely enough, the macro in question works great - up until a speak text action. The macro stops just before the "speak text" action. When I look into the System Log, I see each action of the macro up to (but not including) the speak text action itself. Strange.

About 5-10 of my other macros include a speak text action. Surprisingly, they all fire properly and run perfectly and completely. Everything works great (including the speak text actions) EXCEPT the Mail reminder macro. When I discovered this problem, I tried several fixes:
1. Changing voice stream (in MD settings)
2. Changing voice stream (in speak text statement in macro)
3. Writing a second macro to execute speak text action, and calling macro #2 from the Mail reminder macro.
Sadly, all of my efforts were unsuccessful.

I'm running out of ideas that might fix the problem, so I thought that I would ask for opinions and advice from the "experts".
I'm getting the idea that this might be a bug, but I want people smarter than me to say a few words...

Anyhow, take a look and tell me what you think.

(PS - Anybody want to tell me how I can post a macro on my phone to the forum? Bonus points if you can tell me how to include it in a forum
post.)
 

Endercraft

Moderator (& bug finder :D)
Can you show the macro in question? (3 dots in upper right corner on edit screen > Share as image / Share macro)
 

Endercraft

Moderator (& bug finder :D)
It's because the action is disabled (that's why it's faded). Tap on it then tap on Enable.
 

hendis

Member
Even when every action in the macro was enabled, the system log indicated that every statement in the macro executed properly UP TO (BUT NOT INCLUDING) THE SPEAK TEXT ACTION.

Why does the macro end abnormally?
 

hsurB

Well-known member
Go to configuration of play sound action, click check box at the bottom - block next actons until complete, add wait 200ms before speak text action and let me know if that changed anything. Screenshot of macrodroid's logs after you run the macro in the way I said would be helpful too (in case it still fails)
 

Endercraft

Moderator (& bug finder :D)
Indeed as @Brush meant it is most likely caused by the play sound action that might get stuck or take really long to fully play.
 

hendis

Member
To: @Brush:

Since I am (or we are) now working on this macro again, all statements have been enabled.

"Block next actions until complete" was already checked for the play sound action. (I do this by default for any "play sound" action in every macro I write.)

As you can see, I did not have the 200 ms wait. It has just been added.

In the "Speak Text" action configuration screen, the "Queue text..." and "Block next action until complete" checkboxes have always been ticked. (Again, this is a routine action that I always do for all Speak Text statements in any macro.) The sound stream is set to Alarm.

TESTING TRIGGER...

I am sitting at home, and consequently unable to fire the macro normally, but I can (and did) just test the trigger (tap the trigger, then tap "Test Trigger"). The Speak Text action DID work properly. However, back when I was initially writing the Mail macro, part of my development procedure is to tap "Test Trigger" anyway. It worked then, so I'm not surprised that it works now. What truly puzzled me was that the macro would work properly when the "Test Trigger" was invoked, but the macro would NOT work when I was actually entering the geofence.

We will see what happens when I am actually entering the geofence, and I will post again at that point.
 

hsurB

Well-known member
System logs are on the main screen of macrodroid, so just click it and take a screenshot
 

hendis

Member
Hope that this works. Had to screenshot, then download, then attach...
 

Attachments

  • Screenshot_20231206-131441.png
    Screenshot_20231206-131441.png
    261.8 KB · Views: 9

hendis

Member
Found it! (Well, I think that I found it...)

The key to solving this was understanding that Google Maps was running when the "Speak Text" action fired. (I'm driving when the macro fires.)

Apparently, on my phone, when a route is selected in Google Maps, it "captures" (and controls) the TTS engine in use, which in turn, controls the "Speak Text" action (but not the Play Sound Action). Just for grins and giggles, I disconnected Bluetooth, too.

I also found out that the "Launch Home Screen" and "Press Back Key" actions didn't help. My goal was to get Google Maps to "release" the sound stream(s) that it had captured. To do this, I had to use a UI action to actually exit navigation, then add a "Press Back Key" twice to get back to the Home screen. I then deleted the misbehaving original Speak Text action and 200ms wait, replacing them with a "Macro Run" action.

So far, the "Speak Text" macro that I wrote fires properly, and the "Speak Text" action in it works, too. (I'll try to share my macro, if anybody wants to see...)

And now, we cross our fingers and wait...
 
Top