Skip to content

Add quality level hint to SpeechRecognitionOptions#186

Open
evanbliu wants to merge 2 commits intoWebAudio:mainfrom
evanbliu:Quality
Open

Add quality level hint to SpeechRecognitionOptions#186
evanbliu wants to merge 2 commits intoWebAudio:mainfrom
evanbliu:Quality

Conversation

@evanbliu
Copy link
Copy Markdown
Collaborator

@evanbliu evanbliu commented Apr 28, 2026

Closes #182

This PR adds the quality level hint to the SpeechRecognitionOptions.


Preview | Diff

@evanbliu evanbliu requested review from hoch and padenot April 28, 2026 18:24
@evanbliu
Copy link
Copy Markdown
Collaborator Author

evanbliu commented May 6, 2026

@padenot, @hoch - Can one of you please take a quick look at this PR? Thanks!

Copy link
Copy Markdown
Member

@hoch hoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with questions. (for my own learning)

Comment thread index.bs
1. If the on-device speech recognition language pack for any <var>lang</var> in {{SpeechRecognitionOptions/langs}} of <var>options</var> is unsupported, return a resolved {{Promise}} with false and skip the rest of these steps.
1. Let <var>promise</var> be <a>a new promise</a>.
1. For each <var>lang</var> in {{SpeechRecognitionOptions/langs}} of <var>options</var>, initiate the download of the on-device speech recognition language for <var>lang</var>.
1. For each <var>lang</var> in {{SpeechRecognitionOptions/langs}} of <var>options</var>, initiate the download of the on-device speech recognition language pack for <var>lang</var> matching the requested {{SpeechRecognitionOptions/quality}} level floor.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this "level floor" is going to be one of 3 options below? (enums)

Comment thread index.bs
@@ -448,6 +455,19 @@ See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072
If {{SpeechRecognitionOptions/processLocally}} of <var>options</var> is false, it means recognition (which could be local or remote) is available.</dd>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, this processLocally doesn't interact with the requested "level floor"?

(e.g. if it is processed remotely, would it automatically the quality to Level 3?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add quality constraint to SpeechRecognitionOptions for on-device recognition

3 participants