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

Side by Side Diff: components/audio_modem/audio_recorder_impl.cc

Issue 1207553004: Turning off effects for audio modem recording. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/audio_modem/audio_recorder_impl.h" 5 #include "components/audio_modem/audio_recorder_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 FROM_HERE, 89 FROM_HERE,
90 base::Bind(&AudioRecorderImpl::FinalizeOnAudioThread, 90 base::Bind(&AudioRecorderImpl::FinalizeOnAudioThread,
91 base::Unretained(this))); 91 base::Unretained(this)));
92 } 92 }
93 93
94 // Private methods. 94 // Private methods.
95 95
96 void AudioRecorderImpl::InitializeOnAudioThread() { 96 void AudioRecorderImpl::InitializeOnAudioThread() {
97 DCHECK(media::AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread()); 97 DCHECK(media::AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread());
98 98
99 media::AudioParameters params = 99 media::AudioParameters params;
100 params_for_testing_ 100 if (params_for_testing_) {
101 ? *params_for_testing_ 101 params = *params_for_testing_;
102 : media::AudioManager::Get()->GetInputStreamParameters( 102 } else {
103 media::AudioManagerBase::kDefaultDeviceId); 103 params = media::AudioManager::Get()->GetInputStreamParameters(
104 media::AudioManagerBase::kDefaultDeviceId);
105 params = media::AudioParameters(params.format(),
106 params.channel_layout(),
107 params.sample_rate(),
108 params.bits_per_sample(),
109 params.frames_per_buffer(),
110 media::AudioParameters::NO_EFFECTS);
111 }
104 112
105 total_buffer_frames_ = kProcessIntervalMs * params.sample_rate() / 1000; 113 total_buffer_frames_ = kProcessIntervalMs * params.sample_rate() / 1000;
106 buffer_ = media::AudioBus::Create(params.channels(), total_buffer_frames_); 114 buffer_ = media::AudioBus::Create(params.channels(), total_buffer_frames_);
107 buffer_frame_index_ = 0; 115 buffer_frame_index_ = 0;
108 116
109 stream_ = input_stream_for_testing_ 117 stream_ = input_stream_for_testing_
110 ? input_stream_for_testing_.get() 118 ? input_stream_for_testing_.get()
111 : media::AudioManager::Get()->MakeAudioInputStream( 119 : media::AudioManager::Get()->MakeAudioInputStream(
112 params, media::AudioManagerBase::kDefaultDeviceId); 120 params, media::AudioManagerBase::kDefaultDeviceId);
113 121
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply( 212 media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply(
205 FROM_HERE, 213 FROM_HERE,
206 base::Bind( 214 base::Bind(
207 base::IgnoreResult(&AudioRecorderImpl::FlushAudioLoopForTesting), 215 base::IgnoreResult(&AudioRecorderImpl::FlushAudioLoopForTesting),
208 base::Unretained(this)), 216 base::Unretained(this)),
209 rl.QuitClosure()); 217 rl.QuitClosure());
210 rl.Run(); 218 rl.Run();
211 } 219 }
212 220
213 } // namespace audio_modem 221 } // namespace audio_modem
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698