Chromium Code Reviews| Index: media/audio/win/audio_manager_win.cc |
| diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc |
| index 82a2ddf9b031d80fbd38026bf0bfab33b1a960e9..18d6940abc32db14578c51eb5da0466e2ef2817a 100644 |
| --- a/media/audio/win/audio_manager_win.cc |
| +++ b/media/audio/win/audio_manager_win.cc |
| @@ -317,4 +317,22 @@ AudioManager* CreateAudioManager() { |
| return new AudioManagerWin(); |
| } |
| +AudioParameters AudioManagerWin::GetPreferredLowLatencyOutputStreamParameters( |
| + const AudioParameters& input_params) { |
| + // If WASAPI isn't supported we'll fallback to WaveOut, which will take care |
| + // of resampling and bits per sample changes. |
| + int sample_rate = input_params.sample_rate(); |
| + 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.
|
| + if (IsWASAPISupported()) { |
| + sample_rate = GetAudioHardwareSampleRate(); |
| + bits_per_sample = 16; |
| + } |
| + |
| + // TODO(dalecurtis): This should include bits per channel and channel layout |
| + // eventually. |
| + return AudioParameters( |
| + AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(), |
| + sample_rate, bits_per_sample, GetAudioHardwareBufferSize()); |
| +} |
| + |
| } // namespace media |