-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STT service fails when screen is turned off or locked #154
Comments
Btw, this is not Tasker specific. STT services fails too if I press the microphone button in my contacts app and quickly turn off the screen. But Tasker is the actual use case where I need speech recognition with screen off. |
Hi, The technical part of the issue seems to be that if the screen is turned off the onStop() method of the Dicio Voice Input Activity is called which cancels the speech input. I am not sure how google avoids this since this is usually the wanted behavior if the activity is not stopped due to screen turning off but because the user touched somewhere outside the speech input dialog. |
Hey nebkrid, thanks for looking at this. When Google STT is used as backend for Tasker with screen on, there is a pop up in the middle of the screen (microphone symbol). As mentioned, it also works when screen is locked/off. I tried with another app "Automate", where its called the Speech Recognition block. This one uses Google without asking, so I can't select Dicio. There is no visible pop up at all, but it works (also with screen locked/off). As usual, internet connection is required. For comparison, the "Get Voice" task from Tasker opens a system dialog at first use (choose which app to perform this action with, Just Once/Always). The same happens when I click on the microphone button in the contacts app. The choice is saved system wide. |
Ok, then it is generally the same way of android request like the one dicio has implemented currently.
This is the issue what I can not test, because on my device the google one immediatly finishes too, when it is started by a delayed task when the screen is off (I can here the start sound but immediatley the end sound.) Therefore I am currently not very optimistic that I can fix this to behave identically on you phone... Generall
This is indeed the automation app I am using, too. I observed the same behaviour, though I am not sure why it is this way. Maybe automate explicitly calls the google service. However, I could overcome this by using an "App decision?" block with Action="android.speech.action.RECOGNIZE_SPEECH" and extracting the spoken text from the extras dicitionary with extras["android.speech.extra.RESULTS"]. This way it works if the screen is on (but not off - so effectivley the same like the Tasker GetVoice...) => So, unfortunatley, I have no idea how to get it solved with the popup since I can not compare / test it. But for future it might be possible with the way of background request which is in development. See #161 and the discussion in #151. You can even give the test app a try, but this is on an very early stage. |
Hey there, first of all thanks for the continuous work on this app. I'm very happy to see that a speech service for other apps was included lately.
I started to integrate Dicio's speech recognition into Tasker using the "Get Voice" task. It works reliable and quick enough on my device (Lineage OS 19).
The only problem occurs when I activate it while the screen is turned off, or turned on but locked. Then it aborts listening or fails to hear anything.
Here's an example task to reproduce the issue:
When I start this task with screen on, it works fine. when I turn off or lock the screen before the Get Voice command is finished, it fails to hear anything.
To narrow down the problem I tried 2 things:
I have granted the "Use Microphone only while using the app" permission to both Dicio and Google Speech Services.
The text was updated successfully, but these errors were encountered: