Android Question TTS Text to Speech Library initializes on targetSdkVersion 29 or less but not on 30 or 31

MichaelAust

Member
Licensed User
Longtime User
Having got a newer phone with Android 13, I am working through getting an app of mine working properly on it, and I would like to have TTS working in this app.
I have attached a small project which is based on the code posted by Erel in the thread https://www.b4x.com/android/forum/threads/google-tts-key_param_pan-parameter-implementation.127635/
I have done a lot of searching, and that was the most recent TTS related thread I could find.
The library works fine when targetSdkVersion is 28 or 29 in the Manifest Editor, but doesn't initialize (the button is greyed out) when it is set to 30 or 31
I am running B4A 12.20, and have installed the latest jdk and command line tools.
I thought it might be permission related, but Logs > List Permissions only shows android.permission.FOREGROUND_SERVICE so I don't think that is the problem.
Any help would be greatly appreciated.
 

Attachments

  • TTS_MyTest3.zip
    10 KB · Views: 61

DonManfred

Expert
Licensed User
Longtime User
A B4XPages must be exported with the link in Mainpage

B4X:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
 
Upvote 0

MichaelAust

Member
Licensed User
Longtime User
I guess I will just set targetSdkVersion to 29, the rest of the app should be fine.
The phone it doesn't work on is a Pixel 4a 5g, but with Graphene os, so that is probably it,
Thanks for testing my code.
 
Upvote 0
Top