tts-util-app icon indicating copy to clipboard operation
tts-util-app copied to clipboard

Starting a TTS job externally through adb.

Open sweetbbak opened this issue 2 years ago • 3 comments

Would it be possible to pass text to TTS Util using adb and an intent? I'm just curious because I'm using Waydroid on Linux and I'm exploring options to pass text to Waydroid in various ways. There's not a lot that can easily be done because everything under Waydroid is owned by Root. Port forwarding could work but then I can't pause TTS playback. It would be nice to use ADB to pass text to tts util.

Thank you for your work, I get a lot of use and enjoyment out of it while I listen to novels all day and night lol

sweetbbak avatar Jun 26 '23 01:06 sweetbbak

Hello @sweetbbak,

Thank you for opening this issue. It is already possible to instruct TTS Util to read text using ADB. However, it is not ideal. You can try it with the following incantation:

adb shell am start -n com.danefinlay.ttsutil/.ui.TextActionActivity -a android.intent.action.SEND -e android.intent.extra.TEXT 'Hello from the Android Debug Bridge.'

This results in the device quickly switching to and from a blank activity which enqueues the text for playback and exits. It doesn't look very nice. I'll see if I can add a nicer way of allowing this and document it somewhere.

drmfinlay avatar Jun 28 '23 08:06 drmfinlay

Thank you so much! That is perfect

sweetbbak avatar Jun 28 '23 15:06 sweetbbak

No worries! I have figured out a nicer way that uses the activity manager (am) broadcast command instead of start. It requires some changes though. Should be possible in the next version.

drmfinlay avatar Jun 29 '23 02:06 drmfinlay