[webkit-reviews] review granted: [Bug 219459] Implement recognizer for SpeechRecognition : [Attachment 416028] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 14 01:09:42 PST 2020


youenn fablet <youennf at gmail.com> has granted Sihui Liu <sihui_liu at apple.com>'s
request for review:
Bug 219459: Implement recognizer for SpeechRecognition
https://bugs.webkit.org/show_bug.cgi?id=219459

Attachment 416028: Patch

https://bugs.webkit.org/attachment.cgi?id=416028&action=review




--- Comment #23 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 416028
  --> https://bugs.webkit.org/attachment.cgi?id=416028
Patch

LGTM.
As a side question, do we have enough existing tests for abort and stop cases?

View in context: https://bugs.webkit.org/attachment.cgi?id=416028&action=review

> Source/WebCore/Modules/speech/cocoa/SpeechRecognizerCocoa.mm:48
> +    m_task = adoptNS([[taskClass alloc] initWithIdentifier:identifier
locale:localeIdentifier doMultipleRecognitions:continuous
reportInterimResults:interimResults maxAlternatives:alternatives
delegateCallback:[this, weakThis = makeWeakPtr(this)](const
SpeechRecognitionUpdate& update) {

auto& update

> Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm:38
> +static constexpr size_t maximumRecognitionDuration = 60 * 60;

We should probably think about our strategy for a page that is doing speech
recognition and goes into the background on iOS.
It seems to me it might be best to mute the audio capture or maybe stop the
recognition.

There is also the case of a page that is doing recognition and another page
starts audio capture.
Except on iPadOS, the above strategy would also handle this case.

> Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm:85
> +    _maxAlternatives = alternatives;

Can be done as a one liner:
_maxAlternatives = alternatives ? alternatives : 1

> Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm:136
> +    _delegateCallback(SpeechRecognitionUpdate::createResult(_identifier,
datas));

WTFMove(data)

> Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm:214
> +	   return;

Can be added with above if

> Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTaskMock.mm:64
> +    _delegateCallback(SpeechRecognitionUpdate::createResult(_identifier,
datas));

WTFMove()


More information about the webkit-reviews mailing list