Create services/speech for speech recognition service

62 views
Skip to first unread message

Katie D

unread,
Feb 23, 2021, 1:34:58 PM2/23/21
to services-dev
Hello services-dev,

I'd like to create a top-level service directory, services/speech. This will contain a single public mojom, speech_recognition_service.mojom. (proposed change).

I would appreciate your feedback on this!

Background:
On-device speech recognition is used by Chrome browser to caption audio streams in the renderer process, and will soon be used by Chrome OS for captions too. In addition, Chrome OS plans to add additional features that use on-device speech recognition with microphone input. 
The speech recognition service lives in a utility process in Chrome (design) and is split between the browser process and the ML service process in Chrome OS (design).

In order to support offline speech recognition of microphone input, we plan to add a method to existing media::mojom::SpeechRecognitionContext that takes a audio::mojom::StreamFactory. However, StreamFactory itself depends on media::mojom, so adding StreamFactory to speech_recognition_service.mojom in media/ will create a circular dependency. Thus the mojom must move out of media/.

Why services/:
The media/ team recommended I try moving media/mojo/mojom/speech_recognition_service.mojom to a new services/speech directory.
This mojom is used in the renderer process, Chrome browser process, speech recognition service, and content/browser/browser_interface_binders.cc, so it seems to need a high-level directory like services/ instead of components/services or chrome/services.

More:
Googlers, see design at go/cros-dictation-with-soda (audio input section).

Thanks for your help!
Katie

John Abd-El-Malek

unread,
Feb 24, 2021, 1:48:21 AM2/24/21
to Katie D, services-dev
Did you consider moving StreamFactory to media/mojo/mojom/? That would be the equivalent of what we do with C++ code when a lower-level component needs to use something that was previously above it.

--
You received this message because you are subscribed to the Google Groups "services-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to services-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/63cc6170-7f4a-43c3-91a7-7d25a569eef9n%40chromium.org.

Katie D

unread,
Feb 24, 2021, 12:49:02 PM2/24/21
to services-dev, j...@chromium.org, services-dev, Katie D, Olga Sharonova
That's a great idea! I hadn't considered it. It appears StreamFactory only depends on media::mojom so it should be easy to move.

+Olka@ (OWNER of services/audio) what do you think of moving StreamFactory to media::mojom?

-Katie

Olga Sharonova

unread,
Feb 25, 2021, 4:09:35 AM2/25/21
to Katie D, services-dev, j...@chromium.org
I think it should work. (Will need to be renamed into AudioStreamFactory.)

Olga

Katie D

unread,
Feb 26, 2021, 1:29:21 PM2/26/21
to services-dev, Olga Sharonova, services-dev, j...@chromium.org, Katie D
Thanks all! I'll rename and move StreamFactory in this change.
Reply all
Reply to author
Forward
0 new messages