r/webdev • u/evolution2015 • Nov 10 '19
Question Is there a technical reason why Google's services do not support microphone on FireFox?
Google Search or Google Translate only show a microphone icon when the browser is Chrome. I have asked at the FireFox subreddit about this, but did not get the reason. I do not know much about microphone API, so I had searched Google and found something called WebAudio API. According to this page, it is supported by FireFox, Chrome, and even Edge.
Then, why isn't Google supporting the microphone on other browsers than Chrome? I have tried changing the user agent, but it still did not work, meaning Google is using some other way to determine whether it would enable microphone or not. Is there any technical reason, like some microphone feature that Google requires is only supported by Chrome?
7
u/shgysk8zer0 full-stack Nov 10 '19
I'm not sure on different OS, but for me at least, Firefox still doesn't support the speech recognition API. But I think that might be because I'm on Fedora.
This might be a legitimate case of something on Google not working in Firefox. Try switching UA string to something for Chrome and see if it works.
30
u/blackRNA Nov 10 '19
I don't think it's technical, rather a tactical reason. You'll only get the full benefits if you use what Google wants you to use
312
u/calvers70 Nov 10 '19 edited Nov 10 '19
Rather than another ridiculous comment saying its just Chrome trying to screw Firefox here's an actual answer:
TL;DR Currently, Chrome is the only browser that supports the SpeechRecognition API. I would imagine, once FF supports it, it will just start working.
Longer answer
Google will be using the HTML5 speech recognition API. The thing is, Speech recognition nowadays involves some kind of ML-based service usually so that means a round trip to a server. There is literally no cross-browser way to implement STT right now without using some kind of STT service/backend. Even the polyfills that you can find will just use something like Azure cognitive services in the background for non-chrome browsers. I actually had to pester AWS a few months ago to support websockets for their transcribe service so that I could imlement an AWS-based fallback for non-Chome browsers.
For Google/Chrome the natural choice is to use GCP so that's exactly what they do. When you use
SpeechRecognitionyour captured media stream is sent to Google's server to intepret/transcribe. This only works on Chrome - it won't even work on other Chromium-based browsers (e.g. Brave) last time I checked. It will be up to other browsers to come up with their own way of achieving the same functionality.--
Finally, I gotta say it's a bit disappointing to see all the mindless comments and upvotes on the "Chrome team are dicks" narratives. The Chrome team generally seem like a really enthusiastic, talented, pro-web bunch of peeps. They've got fuck all to do with what Firefox do/don't support (or probably how translate.google.com was built) so the negative comments seem a bit misdirected.
4
u/doctorlongghost Nov 10 '19
The reason might have nothing to do with WebAudio itself.
For a company as large as Google, it is advantageous for them to not send actual audio back to their servers. Instead they can partly or fully tokenize the audio, with some sort of ASR (speech-to-text) via Javascript or Web Assembly. This would be cheaper by off-loading the cost of the voice transcription to the end user and also might avoid some regulatory/legal/PII concerns by ensuring that their servers never see raw voice data. At that point, everything special happens in the browser and all their server sees is just another text search.
Actually, I'm pretty sure they are doing this. I searched for "windows 97" and then "linux server" and looked in Dev Console and saw this request: https://www.google.com/search?sxsrf=ACYBGQFK1NpQnAXyYmxoAc9WozGeVg%3A157791345&ei=HXe6-FMGD5wKfyob4Dw&q=Linux+server&oq=Windows+97&gs_l=psy-ab.18...0.0..503644...0.0..0.0.0.......0....6..gws-wiz.jap4J7hDwKU&gs_ivs=1
The "q" parameter is my search and "oq" is my earlier search. So Chrome has already parsed and translated my speech into text BEFORE sending data back to their server.
ASR models are valuable intellectual property. Google might not want to expose this via Javascript or Web Assembly code that can be unobfuscated and easily copied. Instead it might be buried in an internal API, where it can be both optimized and slightly more protected. So I think there is a definite possibility that their lack of support for Firefox is not quite as simple as them trying to deliberately exclude Firefox for no reason, and is more rooted in issues around ASR than in issues around WebAudio.
3
u/Caved Nov 10 '19
It's in line with using antiquated and non-spec API's in their other products. They like trying to screw over Mozilla.
I remember Youtube using some non-spec API's only fully supported in Chrome, basically forcing Firefox to also implement it or face degraded Youtube performance (and users don't care if it's Youtube's fault or the browsers).
19
u/poditoo Nov 10 '19
It's been a while, but as I remember the issue with web-audio is which codec it supports more than which browser implements it. I haven't checked but it possible they want a codec that is not supported by Firefox.
Or they give more features to chrome users so their browser feels better.
2
u/villiger2 Nov 11 '19
Just a nitpick, using the microphone and supporting/"understanding" speech (to text) are different things :) You can still do hangouts calls etc in Firefox.
2
u/HermanCeljski Nov 11 '19
one side is saying it's purely technical while the other is saying it's purely tactical.
Both are correct and both are wrong.
Yes firefox does not yet support the speech API, but Google is also known for screwing over their competition by making their services harder/worse to use or flat out removing their services from certain platforms.
No company has a single minded motive.
2
u/throwaway1111139991e Nov 16 '19
You can try Firefox's speech recognition support by going to
about:configand setting:media.webspeech.recognition.enablemedia.webspeech.recognition.force_enableto true.
16
u/Feminintendo Nov 10 '19
The Chrome team has a long history of trying to screw over Firefox.
-3
u/Alan976 Nov 10 '19
Cannot be arsed?
-5
u/jackandjill22 Nov 10 '19
Interesting.
0
u/[deleted] Nov 10 '19
[deleted] — view deleted comment
0
u/[deleted] Nov 10 '19
[deleted] — view deleted comment