Last Comment Bug 1248897 - Expose SpeechRecognition to the web
: Expose SpeechRecognition to the web
Status: REOPENED
[webcompat]
:
Product: Core
Classification: Components
Component: Web Speech (show other bugs)
: Trunk
: Unspecified Unspecified
-- enhancement with 7 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: André Natal
Mentors:
http://mdn.github.io/web-speech-api/s...
Depends on:
Blocks: 973754 1244460
  Show dependency treegraph
 
Reported: 2016-02-17 01:58 PST by Sebastian Zartner [:sebo]
Modified: 2017-01-26 05:25 PST (History)
19 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
affected


Attachments

Description User image Sebastian Zartner [:sebo] 2016-02-17 01:58:26 PST
The SpeechRecognition API is currently only available in chrome context (at least on desktop Firefox).

It should also be made available within the website context.

This will require some kind of UI to control the permissions to access the microphone.

Sebastian
Comment 1 User image Marco Castelluccio [:marco] 2016-04-18 03:58:43 PDT Comment hidden (obsolete)
Comment 2 User image Biju 2016-04-18 18:07:26 PDT
(In reply to Marco Castelluccio [:marco] from comment #1)
> 
> *** This bug has been marked as a duplicate of bug 1244460 ***

bug 1244460 is both Speech Recognition and Synthesis, but this is only SpeechRecognition. So how is duplicate
Comment 3 User image Marco Castelluccio [:marco] 2016-04-19 02:14:45 PDT Comment hidden (obsolete)
Comment 4 User image Dão Gottwald [:dao] 2016-06-04 06:21:31 PDT
Is this on anyone's radar? Just ran into a website saying that it "requires Google Chrome Browser". :( I emailed the developers, they say they need the webspeech API.
Comment 5 User image Sebastian Zartner [:sebo] 2016-06-04 12:34:07 PDT
I'm just the reporter, not an implementor.

Sebastian
Comment 6 User image kdavis 2016-06-05 23:28:37 PDT
Both Andre and myself implemented this originally; however, both of us are now in Connected Devices and consumed with preparation for London. So, at the earliest we could take a look after London. But even then it will be hard for us to dedicate lots of time to desktop.
Comment 7 User image Andrew Overholt [:overholt] 2016-06-06 12:38:11 PDT
Let me see what I can do about prioritizing this on the platform side (I was going to suggest Andre/Kelly, too).
Comment 8 User image Daniele "Mte90" Scasciafratte 2016-10-17 05:21:50 PDT
The demo https://mdn.github.io/web-speech-api/ is useless without the api available...
Comment 9 User image Clemens Tolboom 2016-10-17 07:41:02 PDT
The documentation https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API and it's examples implementations are not working in Firefox yet which is a little poor documented in section https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API#Browser_compatibility IHMO; Firefox Desktop is probably the browser right?

The demos work in Google Chrome (un)fortunately.
Comment 10 User image Makoto Kato [:m_kato] 2016-10-17 21:46:38 PDT
Actually, there is no backend implementation for Recognition API except to Gonk.
Comment 11 User image Sebastian Zartner [:sebo] 2016-10-17 23:21:10 PDT
(In reply to Makoto Kato [:m_kato] from comment #10)
> Actually, there is no backend implementation for Recognition API except to
> Gonk.

Bug 1244237 comment 0 claimed something else. That's why I created this bug.
But if there's really no backend yet, you should create a bug for it blocking this one, so this feature can finally be tackled.

Sebastian
Comment 12 User image Abhishek 2017-01-16 17:21:55 PST
I am willing to work on this. Can somebody guide me on this one, what exactly is impeding the implementation of the recognition back end. I was thinking if we can use the speech recognition API provided by windows (not a platform independent solution, I know). It would be great to get it working at least somewhere and I am working on Windows version.
Comment 13 User image Clemens Tolboom 2017-01-17 01:01:32 PST
@abhishek the way I understand you can test this using Firefox desktop in Chrome context so use js or create a plugin. We 'only' need to expose this into website context. See 'User story' above.

From https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment

> devtools.chrome.enabled = true. This enables to run JavaScript code snippets in the chrome context of the Scratchpad from the Tools menu. Don't forget to switch from content to browser as context.

Does this help you?
Comment 14 User image Abhishek 2017-01-17 04:51:46 PST
(In reply to Clemens Tolboom from comment #13)
> @abhishek the way I understand you can test this using Firefox desktop in
> Chrome context so use js or create a plugin. We 'only' need to expose this
> into website context. See 'User story' above.
> 
> From
> https://developer.mozilla.org/en-US/Add-ons/
> Setting_up_extension_development_environment
> 
> > devtools.chrome.enabled = true. This enables to run JavaScript code snippets in the chrome context of the Scratchpad from the Tools menu. Don't forget to switch from content to browser as context.
> 
> Does this help you?

I still get the error "Exception: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable". I enabled devtools.chrome and webspeech.recognition, still can't get it to work. Can you verify that you've got speech input to work on desktop firefox somehow?
Comment 15 User image Clemens Tolboom 2017-01-17 05:45:47 PST
@abhishek what script are you running in Web developer > Scratchpad ?

Checking with from https://github.com/mdn/web-speech-api/blob/master/speech-color-changer/script.js running lines 1-9 + 'recognition;' as line 10 from Scratchpad on page about:config shows me the object SpeechRecognition __proto__: SpeechRecognitionPrototype when inspecting 'recognition;'

Remark #2 on https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API#Browser_compatibility is about this issue :)

Please place your code on https://gist.github.com/ for other to help
Comment 16 User image Abhishek 2017-01-17 06:56:15 PST
(In reply to Clemens Tolboom from comment #15)
> @abhishek what script are you running in Web developer > Scratchpad ?
> 
> Checking with from
> https://github.com/mdn/web-speech-api/blob/master/speech-color-changer/
> script.js running lines 1-9 + 'recognition;' as line 10 from Scratchpad on
> page about:config shows me the object SpeechRecognition __proto__:
> SpeechRecognitionPrototype when inspecting 'recognition;'
> 
> Remark #2 on
> https://developer.mozilla.org/en-US/docs/Web/API/
> Web_Speech_API#Browser_compatibility is about this issue :)
> 
> Please place your code on https://gist.github.com/ for other to help

I am trying that exact same script. Here's the gist: https://gist.github.com/Abhishek8394/dbf9338a9baf6ca05639929e0b72404d
Also the remark #2 as mentioned, it says that recognition hasn't been implemented yet asks to enable an option?
Comment 17 User image André Natal 2017-01-26 05:25:14 PST
One needs to build Firefox with the flags turned on to include the only current implementation available (pocketsphinx + english). If you guys are willing to move forward with it, I can help you to set and have it running.

Note You need to log in before you can comment on or make changes to this bug.