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

Side by Side Diff: content/browser/speech/speech_recognizer_impl.cc

Issue 2702323002: Move AudioDebugFileWriter from content/ to media/. (Closed)
Patch Set: Code review, unit test fix and rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/speech/speech_recognizer_impl.h" 5 #include "content/browser/speech/speech_recognizer_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "content/browser/browser_main_loop.h" 15 #include "content/browser/browser_main_loop.h"
16 #include "content/browser/media/media_internals.h" 16 #include "content/browser/media/media_internals.h"
17 #include "content/browser/speech/audio_buffer.h" 17 #include "content/browser/speech/audio_buffer.h"
18 #include "content/public/browser/speech_recognition_event_listener.h" 18 #include "content/public/browser/speech_recognition_event_listener.h"
19 #include "media/audio/audio_file_writer.h"
20 #include "media/audio/audio_manager.h" 19 #include "media/audio/audio_manager.h"
21 #include "media/audio/audio_system.h" 20 #include "media/audio/audio_system.h"
22 #include "media/base/audio_converter.h" 21 #include "media/base/audio_converter.h"
23 22
24 #if defined(OS_WIN) 23 #if defined(OS_WIN)
25 #include "media/audio/win/core_audio_util_win.h" 24 #include "media/audio/win/core_audio_util_win.h"
26 #endif 25 #endif
27 26
28 using media::AudioBus; 27 using media::AudioBus;
29 using media::AudioConverter; 28 using media::AudioConverter;
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 DVLOG(1) << "SRI::input_parameters: " 626 DVLOG(1) << "SRI::input_parameters: "
628 << input_parameters.AsHumanReadableString(); 627 << input_parameters.AsHumanReadableString();
629 } 628 }
630 629
631 // Create an audio converter which converts data between native input format 630 // Create an audio converter which converts data between native input format
632 // and WebSpeech specific output format. 631 // and WebSpeech specific output format.
633 audio_converter_.reset( 632 audio_converter_.reset(
634 new OnDataConverter(input_parameters, output_parameters)); 633 new OnDataConverter(input_parameters, output_parameters));
635 634
636 audio_controller_ = AudioInputController::Create( 635 audio_controller_ = AudioInputController::Create(
637 GetAudioSystem()->GetAudioManager(), this, this, nullptr, nullptr, 636 GetAudioSystem()->GetAudioManager(), this, this, nullptr,
638 input_parameters, device_id_, 637 input_parameters, device_id_,
639 /*agc_is_enabled*/ false); 638 /*agc_is_enabled*/ false,
639 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE));
640 640
641 if (!audio_controller_.get()) { 641 if (!audio_controller_.get()) {
642 return Abort( 642 return Abort(
643 SpeechRecognitionError(SPEECH_RECOGNITION_ERROR_AUDIO_CAPTURE)); 643 SpeechRecognitionError(SPEECH_RECOGNITION_ERROR_AUDIO_CAPTURE));
644 } 644 }
645 645
646 audio_log_->OnCreated(0, input_parameters, device_id_); 646 audio_log_->OnCreated(0, input_parameters, device_id_);
647 647
648 // The endpointer needs to estimate the environment/background noise before 648 // The endpointer needs to estimate the environment/background noise before
649 // starting to treat the audio as user input. We wait in the state 649 // starting to treat the audio as user input. We wait in the state
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 engine_error(SPEECH_RECOGNITION_ERROR_NONE) { 898 engine_error(SPEECH_RECOGNITION_ERROR_NONE) {
899 } 899 }
900 900
901 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(const FSMEventArgs& other) = 901 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(const FSMEventArgs& other) =
902 default; 902 default;
903 903
904 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { 904 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() {
905 } 905 }
906 906
907 } // namespace content 907 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_input_renderer_host_unittest.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698