How to implement speech recognition in android webview - javascript

I asked a question on how to implement speech recognition in android webview, but got no response for quite a while now. I would like to know if speech recognition is practical in android webview; if so, how does it work? If it doesn't work, can someone please tell me plainly?

Related

How Can I Implemente Language Server In Android EditText

i just wanted to create a codeEditor for android that's why i want a langauge-server i dont know how to implement language server in android please tell me if you know

Bad results on web speech recognition on safari browser

Greetins,
I am currently trying to implement a speech recognition functionality on my application. According to the JS documentation here, speech to text is supported since Safari 14.1. Also, I am using the following configurations:
const { webkitSpeechRecognition } = (window as any)
const recognition = new webkitSpeechRecognition();
recognition.lang = 'pt-BR';
recognition.continuous = true;
recognition.interimResults = false;
recognition.maxAlternatives = 1;
// Avoid garbage collection bugs
this.garbage.push(recognition);
recognition.start();
On Chrome it works just fine, but on Safari the recognition results are super bad. It can understand me sometimes, but often it misinterprets my words, giving me wrong results. For example, if I say: "Hello assistant, change contrast", the result might be something like: "Hello assist charge contract hello assist charge charge" or something.
One peculiarity of this problem is that the events fired by the speech recognition interface on safari are just the start and audiostart.
Is anyone facing a similar issue or found a solution to this problem? I am also accepting alternatives for implementing speech recognition on my application.
Thanks in advance!
EDIT
On my end, you can see this problem by visiting any website that relies on the Web Speech API. Some examples that you can check:
https://www.google.com/chrome/demos/speech.html
https://www.audero.it/demo/web-speech-api-demo.html
So, if anyone else stumbles at this problem, I have filled an issue at the chromium forum. You can consult the issue here.
Basically, the Chrome team is having some problems integrating this functionality in their browser on iOS devices.
In my case, what I did was use Hark.js to get events based on when the user starts and stops speaking paired with Vosk on my backend to do the offline Speech-to-Text translation.
IMO the browser speech recognition API is fine if you want your app to run on a specific browser. However, if you wish to target all browsers accross different operational systems, I would advise looking for a different solution.

WebRTC support for android

I wanted to build video calling app using webRTC and went through lot of websites searching for that but found nothing, just disappointment as most of websites provided the steps for the web and the other said to visit this link "https://webrtc.org/native-code/development/" for native android sdk of webRTC, which shows 404 error. I just want to know, google don't provide native android sdk?. So, I can't build native android app with webRTC or there is some other method to use webRTC. And if not what's some other way to make video calling app?
Old site moved to: https://webrtc.github.io/webrtc-org/native-code/android/
Not happy with the new site as well tbh.

Web Speech API Bug?

Here in their documentations, they said:
The onspeechstart property of the SpeechRecognition interface Fired when sound that is recognised by the speech recognition service as speech has been detected.
With that in mind why even when I cough or make some noises ( that definitely has not any meaning or speech on it ) SpeechRecognition.onspeechstart fires?
How can I track if the sound that is received is a speech or a noise?
This is a Bug of Web Speech API, Hope that Google fix it in future >>>

PhoneRTC Swift update causes no audio on ios

I've built iOS and Android versions of the PhoneRTC project. 1 Android device (KitKat 4.4) and 1 iOS device (iphone 4, iOS 7.1). Both connected to private lan 192.168.1.x. Also, tried TURN server and confirmed successful TURN server messages in server log.
After fixing Swift compile errors on iOS (NSURL and Regex). All compiles and seems to work without throwing errors. Here's my problem and humbly ask for someone's help.
Audio comes through Android just fine, sounds great. So, iOS microphone records/sends audio successfully to Android and is rendered to Android speaker.
Android permission for the microphone is enabled, however the sounds does not arrive on the iOS side. Nothing is heard on the speaker.
Am I missing something here?
Update: I've confirmed that it is the Android library not sending the microphone audio. iOS to browser works fine. Will add issue to Github.
Cheers.
Rich
The issue was fixed in this commit:
https://github.com/alongubkin/phonertc/commit/8bf270014cdfe6acc6d2cb9aeee624c2d9e39536

Categories

Resources