[Live Caption] Pass a message to the browser when the speech
recognition service is ready. As soon as a user presses play on a video or audio, the caption bubble should appear with the text "Detecting speech...". To do this, this CL introduces an OnSpeechRecognitionReady function to the CaptionHost mojo interface, which is called the first time the ChromeSpeechRecognitionClient receives audio to be sent to the speech service. The ChromeSpeechRecognitionClient is constructed when the media is first constructed, which is why this is called when audio is received rather than when the recognizer is bound (which is when the on_ready_callback is called back to the renderer). The flow of information from the speech recognition service to the UI is as follows: ChromeSpeechRecognitionClient::SendAudioToSpeechRecognitionService() -----chrome::mojom::CaptionHost OnSpeechRecognitionReady----- CaptionHostImpl::OnSpeechRecognitionReady() CaptionController::OnSpeechRecognitionReady( content::WebContents* web_contents) CaptionBubbleControllerViews::OnSpeechRecognitionReady() CaptionBubbleModel::OnReady() Bug: 1055150 Change-Id: Ib5eff4034b236b1ee1c6747628b11f9f21506460 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321406Reviewed-by:Avi Drissman <avi@chromium.org> Reviewed-by:
Alex Gough <ajgo@chromium.org> Reviewed-by:
Katie Dektar <katie@chromium.org> Commit-Queue: Abigail Klein <abigailbklein@google.com> Cr-Commit-Position: refs/heads/master@{#793684}
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment