From f556b9d1f4ee3366962dde327a501c2ed635a164 Mon Sep 17 00:00:00 2001 From: "braveyao@webrtc.org" Date: Fri, 18 Nov 2011 02:17:28 +0000 Subject: [PATCH] This modification is supposed to fix the webrtc issue 144/145. With this fix, people could set/get mic volume before StartSend(). Review URL: http://webrtc-codereview.appspot.com/277007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@971 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/source/win/audio_device_wave_win.cc | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/modules/audio_device/main/source/win/audio_device_wave_win.cc b/src/modules/audio_device/main/source/win/audio_device_wave_win.cc index 645c807eb7..138d67593a 100644 --- a/src/modules/audio_device/main/source/win/audio_device_wave_win.cc +++ b/src/modules/audio_device/main/source/win/audio_device_wave_win.cc @@ -625,6 +625,24 @@ WebRtc_Word32 AudioDeviceWindowsWave::InitMicrophone() } } + WebRtc_UWord32 maxVol = 0; + if (_mixerManager.MaxMicrophoneVolume(maxVol) == -1) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " unable to retrieve max microphone volume"); + return -1; + } + _maxMicVolume = maxVol; + + WebRtc_UWord32 minVol = 0; + if (_mixerManager.MinMicrophoneVolume(minVol) == -1) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " unable to retrieve min microphone volume"); + return -1; + } + _minMicVolume = minVol; + return 0; } @@ -2041,24 +2059,6 @@ WebRtc_Word32 AudioDeviceWindowsWave::InitRecording() WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "utilized device ID : %u", deviceID); WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "product name : %s", caps.szPname); - WebRtc_UWord32 maxVol = 0; - if (_mixerManager.MaxMicrophoneVolume(maxVol) == -1) - { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - " unable to retrieve max microphone volume"); - return -1; - } - _maxMicVolume = maxVol; - - WebRtc_UWord32 minVol = 0; - if (_mixerManager.MinMicrophoneVolume(minVol) == -1) - { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - " unable to retrieve min microphone volume"); - return -1; - } - _minMicVolume = minVol; - // Store valid handle for the open waveform-audio input device _hWaveIn = hWaveIn;