Adjust Bluetooth SCO text-to-speech volume

342 views
Skip to first unread message

ahoc...@unc.edu

unread,
Jan 27, 2022, 10:27:55 AM1/27/22
to Automate
For several years, I've been using an Automate flow to read my phone notifications out loud through my car's Bluetooth SCO link. When a new notification comes in, the flow interrupts whatever is playing on my car's sound system (even the car radio) and reads the notification out loud via a Speak block through the "Bluetooth SCO" audio stream.

I recently got a new Android 11 phone, and there's now a new bug in the flow. The volume on the text-to-speech voice seems to be completely random. On some notifications, it's fine. On others, it's way too low. Even if the notifications come in within a minute of each other and I haven't touched anything on the phone or car, the volume can be different.

I've added blocks to the flow to set the volume on Bluetooth SCO, Voice Call, System, and Text to Speech to 100 percent just before the "Speak" block. But these don't seem to have any effect.

Any idea what's happening here?

Thanks.

Henrik "The Developer" Lindqvist

unread,
Jan 27, 2022, 2:00:26 PM1/27/22
to Automate
I've got other reports of TTS reverting back to English sometimes, even when a Language field is set. I guess it's a related bug, where the Google TTS engine is reusing instances without proper re-initialization.
Sadly i don't think there's much i can do, but in Automate v1.32.4 the Speak block got a new Volume field, maybe setting that will help.

ahoc...@unc.edu

unread,
Jan 27, 2022, 2:06:34 PM1/27/22
to Automate
Thanks.  The volume on the Speak block was the first thing I tried. It's set to 100. I'll continue to experiment to see if I can troubleshoot this.

Henrik "The Developer" Lindqvist

unread,
Jan 27, 2022, 2:13:21 PM1/27/22
to Automate
Does any other app use TTS before to the bug occurs?

ahoc...@unc.edu

unread,
Jan 27, 2022, 3:36:58 PM1/27/22
to Automate
No. Automate is the only app that uses TTS on the phone.  What's odd about this is that I've sometimes had two notifications come in within seconds of each other. Nothing changed on the phone or with the car controls. Yet the volume of the TTS speech was much lower on one of the announcements.

Henrik "The Developer" Lindqvist

unread,
Jan 27, 2022, 5:12:10 PM1/27/22
to Automate
If you start TTS by some other event, not posted notifications, does it make any difference?

ahoc...@unc.edu

unread,
Jan 27, 2022, 9:12:25 PM1/27/22
to Automate
No. I wrote a flow that simply enables Bluetooth SCO every 15 seconds and speaks "This is a test." The volume varies each time it speaks.  

Henrik "The Developer" Lindqvist

unread,
Jan 27, 2022, 10:38:46 PM1/27/22
to Automate
Hmm, in you case it may have to do with audio focus. Maybe the TTS engine lower the volume when it detects playback of other apps, or even the Speak block itself.
Do you have other apps playing audio while the Speak block is executed?
Try the different the Audio focus  options, e.g. None or Exclusive.

Henrik "The Developer" Lindqvist

unread,
Jan 27, 2022, 10:43:45 PM1/27/22
to Automate
Exclusive == Transient lower

ahoc...@unc.edu

unread,
Jan 28, 2022, 2:12:26 PM1/28/22
to Automate
Changing the Audio focus on the speak block doesn't help, but I think you're on to something by looking at the focus.  I noticed that the volume remains consistent if Automate is the foreground app.  But it changes when Automate goes to the background. 

The phone gives me no way to manually change - or even monitor - the volume of the SCO bluetooth channel. None of the four sliders in the Android volume panel - in-call, ring and notification, alarm, media - affect it.

Henrik "The Developer" Lindqvist

unread,
Jan 28, 2022, 9:13:09 PM1/28/22
to Automate
A properly audio focus handling app doesn't lower to "global" volume, i.e. as shown by any slider, it just lowers the playback volume of its particular media/sound player. Since Android 8 it seems the system automatically handles the ducking/lowering:

I don't think there's much i can do, if its the system that doesn't handle "ducking" properly.

Maybe it's caused by SCO, can you somehow try it without going through BT?

ahoc...@unc.edu

unread,
Feb 1, 2022, 9:59:57 AM2/1/22
to Automate
I found that if I place a phone call through the Bluetooth device immediately before I trigger the text-to-speech flow, the volume will be normal on both the phone call and the TTS speech. The system will stay at normal volume for a few minutes, then go back to very low volume on the TTS.  I've added some blocks to the flow to do this programmatically. Each time a notification comes into the phone, the flow places a phone call to a nonsense number (123), hangs up after two seconds, then enables SCO and speaks the notification. That's a clumsy solution, but it's all I've found so far.
Reply all
Reply to author
Forward
0 new messages