Skip to content
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

Dicio Not Listed As Voice Input #126

Closed
OkyDooky opened this issue Dec 30, 2022 · 9 comments · Fixed by #227
Closed

Dicio Not Listed As Voice Input #126

OkyDooky opened this issue Dec 30, 2022 · 9 comments · Fixed by #227
Labels
bug Something isn't working

Comments

@OkyDooky
Copy link

OkyDooky commented Dec 30, 2022

On my Android 9 device, Dicio is listed as a an Assist App, but not a Voice Input option.

Before After
No idea why. :/
@parcelcat
Copy link

Confirmed on Android 13. Dicio is not listed as a voice input option in the Android settings.

@MXC48-zz
Copy link
Contributor

MXC48-zz commented Dec 30, 2022

Also on android 12

@Stypox Stypox added the bug Something isn't working label Dec 30, 2022
@AyoungDukie
Copy link

Yes, this has been discussed a tad in #54 , but the service implemented can be seen by some apps, but not the system currently. AnySoftKeyboard seems to be the main project that has the hooks that Dicio looks for. Once enabled (which is the default setting), I was able to get Dicio to show up for Google Maps and ASK. I could even uninstall ASK after, and Maps still sees Dicio.

But yes, it currently does not have the settings/manifest/hooks to be seen as a system input.

One word of warning, if a different system service gets selected, you will need to re-select Dicio and choose "Always" when launching via ASK (in my case it was an issue with GBoard, and I also had to disable GBoard voice input first).

@AyoungDukie
Copy link

Just looking a tad more, it looks like there are multiple things other voice-input type services target for effective use:

  • System Service (discussed here)
  • API connections (like Dicio already has)
  • A "Keyboard" service (which can just call Dicio's activity/slice for outside voice input)

This is likely not a full list; I confess my background with Android dev work is limited to begin with, and multiple years old at this point. If anyone knows more specifics, please chime in!

@cvzi
Copy link

cvzi commented Jan 3, 2023

Hi, I am the developer of the "Screenshot Tile" app that is listed as "voice input" on the screenshots.

If you want to list Dicio there as voice input, you would have to add a RecognitionService.

This enables other apps to request speech-to-text via SpeechRecognizer. Any app with permission.RECORD_AUDIO can then request speech-to-text with something like the (pseudo) code below:

val speechRecognizer = SpeechRecognizer.createSpeechRecognizer(context)
speechRecognizer.setRecognitionListener(object : RecognitionListener {
    override fun onResults(bundle: Bundle) {
        // here you expect to receive a list of recognized texts sorted by the highest confidence first
    }
    override fun onReadyForSpeech(bundle: Bundle) {}
    override fun onBeginningOfSpeech() {}
    override fun onRmsChanged(v: Float) {}
    override fun onBufferReceived(bytes: ByteArray) {}
    override fun onEndOfSpeech() {}
    override fun onError(i: Int) {}
    override fun onPartialResults(bundle: Bundle) {}
    override fun onEvent(i: Int, bundle: Bundle) {}
})

speechRecognizer.startListening(Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)+some extra parameters like language)

If an app uses this code, that would start the RecognitionService of Dicio (if the user has Dicio selected as "voice input").

The service would listen to audio, do speech-to-text recognition and return the resulting texts back to the calling app via the onResults(bundle: Bundle) callback.
AFAIK Google's own RecognitionService does it this way i.e. only speech-to-text and no other "assistance".

I think additionally Android requires that you add a VoiceInteractionService and a VoiceInteractionSession as well. Those would be started when the "assistant" is activated by the user.

@nebkrid
Copy link
Contributor

nebkrid commented Feb 7, 2023

Dear all,
may you can check #161 whether it shows up there?
Thanks to @cvzi for pointing to his project as example!

I think additionally Android requires that you add a VoiceInteractionService and a VoiceInteractionSession as well. Those would be started when the "assistant" is activated by the user.

I didn't implemented this yet, since it shows already up on at least one device. But it seems that it does not show up on Android 13. Do you maybe know whether this could be related? I couldn't find a reference in the SpeechRecognizer Documentation to this (but have to admit that I didn't read deeply into VoiceInteractionService, since to me it seems that this is seperate from speech input and more focused onto the hands-free-assistant part)

@cvzi
Copy link

cvzi commented Feb 7, 2023

Actually I think I was wrong. I think it is the other way round: if you implemented a VoiceInteractionService, you also need to implement a RecognitionService.

@dessalines
Copy link

dessalines commented Sep 25, 2023

I can verify that android 13 completely removed this setting (at least on my phone), so I think a better route would be to figure out how to open Dicio's speech-to-text intent (I have no idea how to do this), then receive the text back from it somehow.

I plan on implementing this in my keyboard once we figure this out.

@Stypox
Copy link
Owner

Stypox commented Jul 26, 2024

Could you test if #227 works? A testing APK is linked there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants