gsssrao / UnityAndroidSpeechRecognition

This repository is a Unity plugin for Android Speech Recognition (based on Java implementation)
GNU General Public License v3.0
87 stars 29 forks source link

How to remove Google popup #5

Open sweetan008 opened 6 years ago

sweetan008 commented 6 years ago

Hi, Thank you so much for this as a free. It's working awesome but I need your help to resolve my issue. I want to remove or hide google popup when it's started recording. Is there any solution. Thanks in advance Sweetan M

gsssrao commented 6 years ago

Hey @sweetan008 , I am bit busy for a few days. Can you send me a reminder on Saturday? I can try to give you some pointers on how to modify the plugin.

sweetan008 commented 6 years ago

Yaaa sure gsssrao Thank you for your reply.

sweetan008 commented 6 years ago

Hi @gsssrao , what happened?

gsssrao commented 6 years ago

Hey, sorry for the late reply.

Basically, what you need to do to add such a feature is to find Android code which does the same thing i.e does speech recognition without a popup. Once you have the android code, you just need to remake this plugin using that code. The core of this plugin is just these two files. So, to modify this plugin, you just need to modify those files and recreate the plugin as explained in #4.

Kindly let me know if this solves your issue and if you have any additional queries.

sweetan008 commented 6 years ago

hai @gsssrao Thank you for your replay. we will try to solve our problem with your ideas. If we did let you know. or any quarries we will contact you.

UnityStefan commented 6 years ago

Hi, First, thank you @gsssrao for your work! @sweetan008 did you manage to solve this?

Sudals commented 5 years ago

I also want to solve popup related problems. Can you help me with plug-in fixes? Finds material on Android studio But I do not know much about Java. ActiveClass and TestPlugin ask for help fix

gsssrao commented 5 years ago

There seems to be some demand for this feature, so I will try to implement this. The way to go about doing this is as follow:

  1. Find an android java implementation of this feature which is closest to what you all are looking for
  2. Port it as a plugin
  3. Call it in Unity with some UI or button click
Sudals commented 5 years ago

Do I need to modify the JavaScript and create a Unity package with this?

gsssrao commented 5 years ago

It is as I have described above, you would need to follow those steps if you want to do this yourself. You can find the details about experimenting here.

In the first step you will have to fiddle with the android java code. For the last step you will have to modify Unity code, but all my unity scripts are in C#.

3FanYu commented 5 years ago

can you try to implement hiding popup option you're free? i really need this feature, but i'm a noob in coding, and i cant understand your instruction fully since english isn't my native tongue. Thx

gsssrao commented 5 years ago

I was busy with other work, will try to implement it soon.

morrismoppp commented 5 years ago

Hi, First, thank you @gsssrao for your work! I really want to remove popup,but i haven't found the solution,can you help me with that? (I have seen all constants which are used to make android speech recognizer.) (and I am from taiwan,my english is not good,plz don't blame it,thank you)

EAPantsios commented 5 years ago

Hey @gsssrao , i opened the project with android studio but did not find any toast message to modify the popup in the two java classes you mentioned. Are you sure the popup is created in one of those classes? Also thanks for the plugin works great and you don't even need an api key which is kind of strange.

gsssrao commented 5 years ago

@morrismoppp I can try to fix this over this weekend if I get time. Let me know if you have already done some work on this. I think the steps to be followed are just as I had mentioned before:

  1. Find an android java implementation of this feature which is closest to what you all are looking for
  2. Port it as a plugin
  3. Call it in Unity with some UI or button click

@EAPantsios Yes, the popup is created by this line. It is not a toast, it is a recognizer intent and the feature usually comes inbuilt in Android (it was the old way of doing speech recognition couple of years ago) and hence it is not a part of the other Speech APIs and thus you don't need any API keys.

morrismoppp commented 5 years ago

@gsssrao Sorry for replying late,I still can't make it. @EAPantsios Do you know what should I have to replace promptSpeechInput?

EAPantsios commented 5 years ago

@morrismoppp it seems like a native google speech popup. I have come across more speech recognition plugins and they also have this popup. I have not figured out how to remove it.

morrismoppp commented 5 years ago

@EAPantsios thank you for your reply,hope you can find the solution.

gsssrao commented 5 years ago

@EAPantsios @morrismoppp, sorry for consistent postponing. I am busy this week with CES but I will get back on this soon.

thibault-ketterer commented 5 years ago

Hi here, many thanks for that work, just what I needed !

to remove the popup: just use this code instead of basic speech recognition overriding function disable the popup, and let you replace it with anything you like. it works like a charm (I will do this in the next weeks and may keep you posted)

https://github.com/sdsb8432/SpeechToText-Android/blob/master/app/src/main/java/com/sdsb8432/speechtotextdemo/CustomSTT.java

DonghanYang commented 5 years ago

Hi guys, any updates on hiding the pop-up window?

Rtyui commented 5 years ago

Hi. Just wanted to know if there's anyone that already crated the unity package or at least have an archive with the 'no pop-up speech recognition' patch for unity.

Thank you. Best regards.

bhaktiugp commented 5 years ago

Hi, is there any updates on disabling the pop-up window?

I'm sorry that I'm not good with Java, but I wonder is this syntax "intent.putExtra(RecognizerIntent.EXTRA_PROMPT, gQuestion);" at line 50 is the main call for google prompt ?

https://github.com/gsssrao/UnityAndroidSpeechRecognition/blob/master/SpeechPlugin/pluginlibrary/src/main/java/com/plugin/speech/pluginlibrary/TestPlugin.java

thibault-ketterer commented 5 years ago

@bhaktiugp nope, it's just to change the message in the box. Sorry I don't have time for this dev for now.

monire91 commented 4 years ago

Hey, Any updates on this issue?

EricBatlle commented 4 years ago

Well, after a while, for the people that wants this feature, I can offer my own plugin-repository: https://github.com/EricBatlle/UnityAndroidSpeechRecognizer (give it some love!)