Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/audio_io.h" | 5 #include "media/audio/audio_io.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <objbase.h> // This has to be before initguid.h | 8 #include <objbase.h> // This has to be before initguid.h |
| 9 #include <initguid.h> | 9 #include <initguid.h> |
| 10 #include <mmsystem.h> | 10 #include <mmsystem.h> |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 | 310 |
| 311 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, | 311 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, |
| 312 xp_device_id); | 312 xp_device_id); |
| 313 } | 313 } |
| 314 | 314 |
| 315 /// static | 315 /// static |
| 316 AudioManager* CreateAudioManager() { | 316 AudioManager* CreateAudioManager() { |
| 317 return new AudioManagerWin(); | 317 return new AudioManagerWin(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 AudioParameters AudioManagerWin::GetPreferredLowLatencyOutputStreamParameters( | |
| 321 const AudioParameters& input_params) { | |
| 322 // If WASAPI isn't supported we'll fallback to WaveOut, which will take care | |
| 323 // of resampling and bits per sample changes. | |
| 324 int sample_rate = input_params.sample_rate(); | |
| 325 int bits_per_sample = input_params.bits_per_sample(); | |
|
henrika (OOO until Aug 14)
2012/09/14 09:46:46
Do we want this for XP?
DaleCurtis
2012/09/14 09:59:05
It's the existing behavior, so I think so.
| |
| 326 if (IsWASAPISupported()) { | |
| 327 sample_rate = GetAudioHardwareSampleRate(); | |
| 328 bits_per_sample = 16; | |
| 329 } | |
| 330 | |
| 331 // TODO(dalecurtis): This should include bits per channel and channel layout | |
| 332 // eventually. | |
| 333 return AudioParameters( | |
| 334 AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(), | |
| 335 sample_rate, bits_per_sample, GetAudioHardwareBufferSize()); | |
| 336 } | |
| 337 | |
| 320 } // namespace media | 338 } // namespace media |
| OLD | NEW |