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

Side by Side Diff: media/audio/win/audio_low_latency_input_win.cc

Issue 9418042: Adding microphone volume support to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: please review Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/audio/win/audio_low_latency_input_win.h" 5 #include "media/audio/win/audio_low_latency_input_win.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "media/audio/audio_util.h" 10 #include "media/audio/audio_util.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (sink_) { 175 if (sink_) {
176 sink_->OnClose(this); 176 sink_->OnClose(this);
177 sink_ = NULL; 177 sink_ = NULL;
178 } 178 }
179 179
180 // Inform the audio manager that we have been closed. This will cause our 180 // Inform the audio manager that we have been closed. This will cause our
181 // destruction. 181 // destruction.
182 manager_->ReleaseInputStream(this); 182 manager_->ReleaseInputStream(this);
183 } 183 }
184 184
185 void WASAPIAudioInputStream::SetMicVolume(double volume) {
186 // TODO(xians): Add volume support.
187 }
188
189 void WASAPIAudioInputStream::GetMicVolume(double* volume) {
190 }
tommi (sloooow) - chröme 2012/02/21 14:03:25 should this also assign 0.0 to volume? (as GetMaxM
henrika (OOO until Aug 14) 2012/02/21 14:03:47 Add TODO.
no longer working on chromium 2012/02/21 18:01:38 Done.
no longer working on chromium 2012/02/21 18:01:38 Done.
191
192 void WASAPIAudioInputStream::GetMaxMicVolume(double* max_volume) {
193 *max_volume = 0;
henrika (OOO until Aug 14) 2012/02/21 14:03:47 Add TODO.
no longer working on chromium 2012/02/21 18:01:38 Done.
194 }
195
185 // static 196 // static
186 double WASAPIAudioInputStream::HardwareSampleRate(ERole device_role) { 197 double WASAPIAudioInputStream::HardwareSampleRate(ERole device_role) {
187 base::win::ScopedCoMem<WAVEFORMATEX> audio_engine_mix_format; 198 base::win::ScopedCoMem<WAVEFORMATEX> audio_engine_mix_format;
188 HRESULT hr = GetMixFormat(device_role, &audio_engine_mix_format); 199 HRESULT hr = GetMixFormat(device_role, &audio_engine_mix_format);
189 if (FAILED(hr)) 200 if (FAILED(hr))
190 return 0.0; 201 return 0.0;
191 202
192 return static_cast<double>(audio_engine_mix_format->nSamplesPerSec); 203 return static_cast<double>(audio_engine_mix_format->nSamplesPerSec);
193 } 204 }
194 205
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 hr = audio_client_->SetEventHandle(audio_samples_ready_event_.Get()); 537 hr = audio_client_->SetEventHandle(audio_samples_ready_event_.Get());
527 if (FAILED(hr)) 538 if (FAILED(hr))
528 return hr; 539 return hr;
529 540
530 // Get access to the IAudioCaptureClient interface. This interface 541 // Get access to the IAudioCaptureClient interface. This interface
531 // enables us to read input data from the capture endpoint buffer. 542 // enables us to read input data from the capture endpoint buffer.
532 hr = audio_client_->GetService(__uuidof(IAudioCaptureClient), 543 hr = audio_client_->GetService(__uuidof(IAudioCaptureClient),
533 audio_capture_client_.ReceiveVoid()); 544 audio_capture_client_.ReceiveVoid());
534 return hr; 545 return hr;
535 } 546 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698