SpeechRecognization for firefox web extension - google-chrome

As chrome has webkitspeechrecognition api for speech detection , what can we use for firefox webextension(web speech api not working for me).
I'm making an extension which will continuously listen for speech and then process it.
I have already made a chrome extension which is up and running,so wanted to extend it to Firefox, need an alternative to this line(which is for chrome extension)
recognition = new webkitSpeechRecognition();

I haven't used the Speech Recognition API yet, but you should be able to use
recognition = new SpeechRecognition();
In order for this to work, you need to set
media.webspeech.recognition.enable
to true in about:config. Source: https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
There are a number of outstanding bugs around the implementation of Web Speech in Firefox, so I'm not sure the above is implemented or working well. The basic implementation was done in Firefox 44 / 49.

Related

Service Worker - Browser support

CanIUse and MDN doesn;t seems to be agree on the support for service worker. In the midst of Chrome going to remove support for appcach, we are trying to ascertain the impact of moving to Service Worker. Are we reading the above two pages incorrectly?
We tried Google's own samples against device/browser combinations and results wore not encouraging. For example the 'custom offline page' demo failed in iOS Chrome (v80) where it worked in iOS Safari (12.4.5).
The 'Selective caching' and 'Read through caching' pages clearly show "service worker is not supported in the current browser" in Chrome 80. It is checking the if ('serviceWorker' in navigator) {, but other samples doesn't show such a message.
All and all it is confusing on the browser support for the Service worker. Is there there a universally tested sample which we can use as a benchmark for different device/browser combination.
I asked Jake Archibald of Google on this and he replied with the following SO post which must be still valid.
Chrome Service Worker iOS Support
Therefore apparently Safari is the only option at the moment. I am still wondering what Google is recommending developers to use once they remove support for AppCache.
Jake continued saying there is no way they can add support as Apple is not giving them full rights on iOS. But he mentioned appcache will continue to work as usual. His exact words are
"However, since Chrome on iOS is just a skin over Safari, appcache will continue to work while it works in Safari webview."
on iOS only Safari supports service workers. You can test browsers if it supports with this code
if ('serviceWorker' in navigator) { /*supported*/ }

Client-side Speech Recognition on a mobile browser?

I am working on a project that is targeted for browsers on smart phones. And I can't seem to find any way to do a client-side speech recognition, as the mobile version of chrome doesn't even support their own Web Speech API. Does anybody know how to have speech recognition working on a mobile browser like Chrome or Firefox? Or is there a work around that can be used? like a 3rd-party service that provide APIs to be called.
Potential duplicate: Safari Speech Recognition
NOPE: https://caniuse.com/#feat=speech-recognition
NOPE: https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
Not client side but might be of some assistance: https://cloud.google.com/speech-to-text/docs/streaming-recognize
Also this: https://github.com/Kitt-AI/snowboy (seems like need to set up your RasPi)
And this: https://github.com/tensorflow/tfjs I can totally imagine doing all the machine learning in the browser, just like you can run Windows 95 and what not.

Media Source Extension on Firefox and IE

I'm creating a Audio Player with HTML5, using the MediaSource Object.
My code is similar to MediaSource API Demo
But when executing the line
var ms = new MediaSource();
And exception is throwed on Firefox and Internet Explorer
ReferenceError: MediaSource is not defined
In Firefox Support says that this feature is only enabled to Youtube and Netflix.
There is a way to handle this restriction?
In Chrome, I have not problem!
At time of writing, IE11 only has support when run on Windows 8.1 or above.
Firefox will only enable MSE when about:config param media.mediasource.enabled = true (this restriction will be removed eventually, once the FF implementation is globally stable). There is no way around this, so unless you are YouTube or Netflix, consider Firefox MSE as coming soon.
Firefox has been lagging behind quite badly when it comes to MSE support in their browser. Firefox Nightly build however now seems to be pretty close to working properly. It still has to go through nightly build and beta phase before it's released to the public, so expect a few months.

can a google chrome extension flash an OS style alert?

for example, growl flashes a message in the upper right corner regardless of which application is running. Skype makes the icon in the dock have a little red dot with a number of new messages. Is there anyway to write a chrome extension to have this type of functionality? that is, I want to write a chat system that works in the browser but also notifies users when they have closed my site's tab, or even when chrome is not running.
I could write a native client in addition to my browser based client, but that's double the work. (Tripple the work if you bother with a native window's client vs. just OSX but who would do that?)
Chrome can create "Desktop Notifications" See the Documentation
It's also possible to have the notifications visible when chrome is closed providing you create a "background process". this question/answer might point you in the right direction.
Chrome supports the text-only version of the W3C desktop notification standard. Chrome deprecated the HTML version about a year ago and will stop supporting it very soon. Any webpage viewed in Chrome and any Chrome extension can use this API.
The Rich Notifications API is available to Chrome extensions and packaged apps. As of today, it's dev-channel only and is iterating rapidly. It has implementations on ChromeOS and Windows, with Mac on the way. Linux currently delegates to the W3C implementation. The API is not a 1:1 replacement of W3C HTML desktop notifications, but it does provide many layout options for common use cases.

Does Chrome have built-in speech recognition for "x-webkit-speech" input elements?

I'm wondering how
<input type="text" x-webkit-speech speech />
Is there a speech recognition enging built into Chrome or is it accessing an underlying speech recognition facility in the operating system?
Yup, Chrome does speech recognition via Google's servers. But there's no reason that other browsers couldn't choose to implement it differently (for example using some speech recognition facility in the OS).
Balu, your link is actually a bit out of date. The latest Google proposal can be found here: http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html
Although speech recognition has been available in the Chrome dev channel for some time, it has not shipped yet and we're not yet sure when it will ship. We definitely want people to play with the API and offer feedback on it, but we don't think it's quite ready for prime time yet.
According to the code it sends the audio data as a POST request to:
https://www.google.com/speech-api/v1/recognize?client=chromium&lang=??&lm=??&xhw=??&maxresults=3
lm is grammar in the code, xhw is hardware_info which is optional according to a comment. The audio appears to be speex, x-speex-with-header-byte:
// Encode the frame and place the size of the frame as the first byte. This
// is the packet format for MIME type x-speex-with-header-byte.
It looks like it would be pretty trivial to modify the chrome code to use in your own app.
Update:
You also need to get a speech recognition API key and they are limited to 50 requests per day. There is no way to increase that limit - not even by paying.
There is an experimental fork of speexenc that can encode x-speex-with-header-byte MIME binary format, its referenced on the QXIP Wiki and is available on GitHub. Does the job fine by placing the size of the frame as the first byte of packets.
They are using their own API for speech recognition. Ex: sending a post request to there servers.
Speech recognition is a proposal by Google. https://docs.google.com/View?id=dcfg79pz_5dhnp23f5
The feature ships with Chrome 8+ and it looks like it sends the data to google servers to perform the actual recognition.
This feature now works on chrome 11 beta.
check this out..
http://slides.html5rocks.com/#speech-input
This might be of interest https://github.com/taf2/speech2text ruby bindings for the google speech to text API
Yes, Chrome does have built-in speech support through WebKit; just look at the Google homepage (which now has a microphone to the right of the search box). I wonder, however, if the Chrome team is working on Omnibox speech support. After all, Chrome is a WebKit-based browser!
I just confirmed this on my Chrome Cr-48, it works.
There is also a working group that produced http://www.w3.org/TR/xhtml+voice/ but I don't believe this is implemented in any browser except Opera.