Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Issue 549373003: Binding media stream audio track to speech recognition [browser]

Created:
6 years, 3 months ago by burnik
Modified:
4 years, 6 months ago
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Chrome support for providing media stream audio track to speech recognition - browser implementation. WebKit CL : http://crrev.com/448163003 Renderer CL : http://crrev.com/499233003 [ Browser CL ] SpeechRecognitionAudioReceiver allocates and maps the SharedMemory for audio, prepares the SyncSocket and passes those handles to the client which hands them down to the renderer via IPC. Renderer creates the |SpeechRecognitionAudioSink| using those handles. Audio data from the renderer gets delivered to the browser via SyncSocket and SharedMemory listening on a separate |audio_thread_|. Data gets converted to audio chunks which then get passed to the speech recognition engine (as the default implementation would). Synchronization is done via |SyncSocket.Receive()| and incrementing the buffer index in shared memory. Making sure all audio is delivered in order. Design doc: http://goo.gl/9Ot3PC BUG=408940

Patch Set 1 : Clean up #

Patch Set 2 : Rebased and nits #

Total comments: 48

Patch Set 3 : Introduce SpeechRecognitionAudioReceiver #

Total comments: 1

Patch Set 4 : Refactor SpeechRecognitionAudioReceiver #

Patch Set 5 : Revert recognizer impl unit test + nits #

Patch Set 6 : Remove non-effective PostDelayedTask #

Patch Set 7 : Include headers - fix for trybot builds #

Patch Set 8 : Fix recognizer impl unit test on Win #

Patch Set 9 : Audio Receiver unit test #

Total comments: 8

Patch Set 10 : xians' comments #

Patch Set 11 : Move thread to recognizer_impl. Use PostDelayedTask. #

Total comments: 10

Patch Set 12 : Tommi's comments #

Total comments: 31

Patch Set 13 : Refactoring and nits #

Patch Set 14 : SetListening(true) called on IO thread #

Patch Set 15 : Simplify unit test #

Patch Set 16 : Retry tests #

Patch Set 17 : Test from home computer #

Patch Set 18 : Waitable event for synchronous start #

Patch Set 19 : Wait with no timeout #

Unified diffs Side-by-side diffs Delta from patch set Stats (+769 lines, -28 lines) Patch
M chrome/browser/speech/chrome_speech_recognition_manager_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +7 lines, -0 lines 0 comments Download
A content/browser/speech/speech_recognition_audio_receiver.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +131 lines, -0 lines 0 comments Download
A content/browser/speech/speech_recognition_audio_receiver.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +216 lines, -0 lines 0 comments Download
A content/browser/speech/speech_recognition_audio_receiver_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +168 lines, -0 lines 0 comments Download
M content/browser/speech/speech_recognition_dispatcher_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/speech/speech_recognition_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +19 lines, -0 lines 0 comments Download
M content/browser/speech/speech_recognition_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +7 lines, -0 lines 0 comments Download
M content/browser/speech/speech_recognition_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +32 lines, -13 lines 0 comments Download
M content/browser/speech/speech_recognizer.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/speech/speech_recognizer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +21 lines, -0 lines 0 comments Download
M content/browser/speech/speech_recognizer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 chunks +123 lines, -12 lines 0 comments Download
M content/browser/speech/speech_recognizer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +13 lines, -2 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/speech_recognition_event_listener.h View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M content/public/browser/speech_recognition_session_config.h View 2 chunks +3 lines, -0 lines 0 comments Download
M content/public/browser/speech_recognition_session_config.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 38 (7 generated)
tommi (sloooow) - chröme
first set of comments. I think it would make sense for xians to review this ...
6 years, 2 months ago (2014-10-02 11:23:19 UTC) #4
no longer working on chromium
Some more work is needed. + Primiano. https://codereview.chromium.org/549373003/diff/60001/content/browser/speech/speech_recognizer_impl.cc File content/browser/speech/speech_recognizer_impl.cc (right): https://codereview.chromium.org/549373003/diff/60001/content/browser/speech/speech_recognizer_impl.cc#newcode632 content/browser/speech/speech_recognizer_impl.cc:632: base::SharedMemoryHandle foreign_memory_handle; ...
6 years, 2 months ago (2014-10-02 11:55:40 UTC) #6
burnik
Good review round. I would like to continue the discussion on a few matters. Please ...
6 years, 2 months ago (2014-10-02 16:04:12 UTC) #7
no longer working on chromium
The new code in the SpeechRecognizerImpl is getting complicated and hard to read, you should ...
6 years, 2 months ago (2014-10-03 08:57:53 UTC) #8
no longer working on chromium
https://codereview.chromium.org/549373003/diff/60001/content/browser/speech/speech_recognizer_impl.cc File content/browser/speech/speech_recognizer_impl.cc (right): https://codereview.chromium.org/549373003/diff/60001/content/browser/speech/speech_recognizer_impl.cc#newcode699 content/browser/speech/speech_recognizer_impl.cc:699: audio_sync_socket_->Receive(buffer_index_, sizeof(*buffer_index_)); On 2014/10/02 16:04:11, burnik wrote: > On ...
6 years, 2 months ago (2014-10-03 09:13:18 UTC) #9
burnik
Moved most of the code to SpeechRecognitionAudioReceiver. I would appreciate any advice on how to ...
6 years, 2 months ago (2014-10-06 08:32:50 UTC) #11
burnik
Refactor SpeechRecognitionAudioReceiver
6 years, 2 months ago (2014-10-12 20:30:39 UTC) #12
burnik
Refactor SpeechRecognitionAudioReceiver
6 years, 2 months ago (2014-10-12 20:46:00 UTC) #14
burnik
Revert recognizer impl unit test + nits
6 years, 2 months ago (2014-10-12 21:04:26 UTC) #15
burnik
Remove non-effective PostDelayedTask
6 years, 2 months ago (2014-10-12 23:23:22 UTC) #16
burnik
Include headers - fix for trybot builds
6 years, 2 months ago (2014-10-12 23:28:59 UTC) #17
burnik
Fix recognizer impl unit test on Win
6 years, 2 months ago (2014-10-13 00:55:33 UTC) #18
burnik
Audio Receiver unit test
6 years, 2 months ago (2014-10-14 13:56:42 UTC) #19
no longer working on chromium
https://codereview.chromium.org/549373003/diff/800001/content/browser/speech/speech_recognition_audio_receiver.cc File content/browser/speech/speech_recognition_audio_receiver.cc (right): https://codereview.chromium.org/549373003/diff/800001/content/browser/speech/speech_recognition_audio_receiver.cc#newcode17 content/browser/speech/speech_recognition_audio_receiver.cc:17: SpeechRecognitionAudioReceiver* SpeechRecognitionAudioReceiver::Create( use scoped_ptr<SpeechRecognitionAudioReceiver> https://codereview.chromium.org/549373003/diff/800001/content/browser/speech/speech_recognition_audio_receiver.cc#newcode167 content/browser/speech/speech_recognition_audio_receiver.cc:167: size_t bytes_received = ...
6 years, 2 months ago (2014-10-15 12:14:29 UTC) #20
no longer working on chromium
It looks much better, probably we should discuss if we should use the audio thread ...
6 years, 2 months ago (2014-10-15 12:15:12 UTC) #21
burnik
xians' comments
6 years, 2 months ago (2014-10-15 14:50:36 UTC) #22
burnik
Nits done. Tommi: Any inputs or feedback would be appreciated. https://codereview.chromium.org/549373003/diff/80001/content/browser/speech/speech_recognizer_impl.h File content/browser/speech/speech_recognizer_impl.h (right): https://codereview.chromium.org/549373003/diff/80001/content/browser/speech/speech_recognizer_impl.h#newcode47 ...
6 years, 2 months ago (2014-10-15 14:52:28 UTC) #23
burnik
Move thread to recognizer_impl. Use PostDelayedTask.
6 years, 2 months ago (2014-10-16 16:26:07 UTC) #24
tommi (sloooow) - chröme
will take a closer look tomorrow https://codereview.chromium.org/549373003/diff/840001/content/browser/speech/speech_recognition_audio_receiver.cc File content/browser/speech/speech_recognition_audio_receiver.cc (right): https://codereview.chromium.org/549373003/diff/840001/content/browser/speech/speech_recognition_audio_receiver.cc#newcode63 content/browser/speech/speech_recognition_audio_receiver.cc:63: Stop(); is this ...
6 years, 2 months ago (2014-10-16 21:20:23 UTC) #25
burnik
Tommi's comments
6 years, 2 months ago (2014-10-17 10:46:56 UTC) #26
burnik
One or two open questions. Prepping the unit test to support the audio thread as ...
6 years, 2 months ago (2014-10-17 10:48:02 UTC) #27
no longer working on chromium
Looking better, some comments. https://codereview.chromium.org/549373003/diff/860001/content/browser/speech/speech_recognition_audio_receiver.cc File content/browser/speech/speech_recognition_audio_receiver.cc (right): https://codereview.chromium.org/549373003/diff/860001/content/browser/speech/speech_recognition_audio_receiver.cc#newcode18 content/browser/speech/speech_recognition_audio_receiver.cc:18: const media::AudioParameters& audio_params, fix the ...
6 years, 2 months ago (2014-10-17 12:28:11 UTC) #28
burnik
Refactoring and nits
6 years, 2 months ago (2014-10-23 13:50:33 UTC) #29
burnik
A bit of refactoring is done. The failing unit tests are still in this patch. ...
6 years, 2 months ago (2014-10-23 13:56:37 UTC) #30
burnik
SetListening(true) called on IO thread
6 years, 2 months ago (2014-10-23 14:39:54 UTC) #31
burnik
Simplify unit test
6 years, 2 months ago (2014-10-23 17:50:25 UTC) #32
burnik
Retry tests
6 years, 2 months ago (2014-10-24 09:01:42 UTC) #33
burnik
Waitable event for synchronous start
6 years, 1 month ago (2014-11-02 23:51:58 UTC) #34
burnik
Wait with no timeout
6 years, 1 month ago (2014-11-03 02:26:14 UTC) #35
aplier951
4 years, 6 months ago (2016-06-09 20:52:27 UTC) #37
aplier951
4 years, 6 months ago (2016-06-09 20:52:29 UTC) #38

          

Powered by Google App Engine
This is Rietveld 408576698