Expose SpeechRecognition to the web

REOPENED
Assigned to

Status

()

Core
Web Speech
--
enhancement
REOPENED
2 years ago
2 days ago

People

(Reporter: sebo, Assigned: André Natal)

Tracking

(Depends on: 1 bug, Blocks: 2 bugs)

Trunk
Points:
---
Dependency tree / graph
Bug Flags:
webcompat ?

Firefox Tracking Flags

(firefox47 affected)

Details

(Whiteboard: [webcompat], URL)

(Reporter)

Description

2 years ago
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
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1244460
Comment hidden (obsolete)
Comment hidden (obsolete)
Blocks: 973754
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.
Flags: needinfo?(sebastianzartner)
Flags: needinfo?(overholt)
Flags: needinfo?(dietrich)
(Reporter)

Comment 5

a year ago
I'm just the reporter, not an implementor.

Sebastian
Flags: needinfo?(sebastianzartner)

Updated

a year ago
Flags: needinfo?(anatal)

Updated

a year ago
Flags: needinfo?(kdavis)

Comment 6

a year ago
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.
Flags: needinfo?(kdavis)
Flags: needinfo?(anatal)
Let me see what I can do about prioritizing this on the platform side (I was going to suggest Andre/Kelly, too).
Flags: needinfo?(overholt)
Flags: needinfo?(dietrich)
The demo https://mdn.github.io/web-speech-api/ is useless without the api available...

Comment 9

10 months ago
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

10 months ago
Actually, there is no backend implementation for Recognition API except to Gonk.
(Reporter)

Comment 11

10 months ago
(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

7 months ago
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

7 months ago
@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

7 months ago
(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

7 months ago
@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

7 months ago
(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?

Updated

7 months ago
Whiteboard: [webcompat]
(Assignee)

Comment 17

7 months ago
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.

Updated

4 days ago
Flags: webcompat?
(Assignee)

Updated

2 days ago
Assignee: nobody → anatal
Depends on: 1392065
You need to log in before you can comment on or make changes to this bug.