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

Unified Diff: content/browser/speech/speech_recognizer.cc

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Set svn eol properties for a couple of files Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/speech/speech_recognizer.h ('k') | content/browser/speech/speech_recognizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/speech_recognizer.cc
===================================================================
--- content/browser/speech/speech_recognizer.cc (revision 114012)
+++ content/browser/speech/speech_recognizer.cc (working copy)
@@ -61,6 +61,7 @@
const std::string& language,
const std::string& grammar,
net::URLRequestContextGetter* context_getter,
+ AudioManager* audio_manager,
bool filter_profanities,
const std::string& hardware_info,
const std::string& origin_url)
@@ -72,6 +73,7 @@
hardware_info_(hardware_info),
origin_url_(origin_url),
context_getter_(context_getter),
+ audio_manager_(audio_manager),
codec_(AudioEncoder::CODEC_FLAC),
encoder_(NULL),
endpointer_(kAudioSampleRate),
@@ -111,7 +113,8 @@
AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout,
kAudioSampleRate, kNumBitsPerAudioSample,
samples_per_packet);
- audio_controller_ = AudioInputController::Create(this, params);
+ audio_controller_ = AudioInputController::Create(audio_manager_, this,
+ params);
DCHECK(audio_controller_.get());
VLOG(1) << "SpeechRecognizer starting record.";
num_samples_recorded_ = 0;
@@ -215,7 +218,7 @@
bool speech_was_heard_before_packet = endpointer_.DidStartReceivingSpeech();
const short* samples = reinterpret_cast<const short*>(data->data());
- DCHECK((data->length() % sizeof(short)) == 0);
+ DCHECK_EQ((data->length() % sizeof(short)), 0U);
int num_samples = data->length() / sizeof(short);
encoder_->Encode(samples, num_samples);
float rms;
« no previous file with comments | « content/browser/speech/speech_recognizer.h ('k') | content/browser/speech/speech_recognizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698