Android Question can TTS keep speaking while in sleep or locked mode

Gina Kalani

New Member
Thank you Erel, will try in a short while, still not at the point to test it but soon.
Is there a tutorial for TTS library. Equivalents to speak, silence etc.?
 
Upvote 0

Branko Milosevic

Active Member
Licensed User
Would it be possible to call starter service from the activity where TTS code currently is and then let starter service call back the activity sub with TTS code.
 
Upvote 0

Branko Milosevic

Active Member
Licensed User
Huh...not working.
Question 1: What code exactly needs to be in the Sub Service_Start?

This is what I have now:

In "Starter"
B4X:
'in Starter

Sub Process_Globals
    Dim TTS1 AsTTS
End Sub


Sub Service_Start (StartingIntent As Intent)

   CallSub(CurrentSession,"SessionPlay")

End Sub

In activity "Current Session"

B4X:
'in activity CurrentSession

Sub Activity_Resume
      If Starter.TTS1.IsInitialized = FalseThen
          Starter.TTS1.Initialize("TTS1")
      EndIf
End Sub

Sub btnPlay_click()
   'this is play button that use to call SessionPlay sub
   'It now calls Service_start which is supposed to call back SessionPlay
    CallSub(Starter, "Service_Start")
    'SessionPlay
End Sub


Sub SessionPlay()
  'here is tts code that I would like to keep here in activity "CurrentSession"
End Sub
Question 2.: Should I just initialize TTS1 in Service_Start?
Question 3.: What exectly starts the Service_Start?
 
Last edited:
Upvote 0
Top