Index: media/audio/win/audio_low_latency_input_win.cc |
diff --git a/media/audio/win/audio_low_latency_input_win.cc b/media/audio/win/audio_low_latency_input_win.cc |
index 9fe061b7682b6e7ceeb3f256307a8c34293d8b2d..8df8620b9f3decd7f23d45f87243b77e562c16bd 100644 |
--- a/media/audio/win/audio_low_latency_input_win.cc |
+++ b/media/audio/win/audio_low_latency_input_win.cc |
@@ -253,7 +253,7 @@ void WASAPIAudioInputStream::SetVolume(double volume) { |
} |
double WASAPIAudioInputStream::GetVolume() { |
- DLOG_IF(ERROR, !opened_) << "Open() has not been called successfully"; |
+ DCHECK(opened_) << "Open() has not been called successfully"; |
if (!opened_) |
return 0.0; |
@@ -265,6 +265,20 @@ double WASAPIAudioInputStream::GetVolume() { |
return static_cast<double>(level); |
} |
+bool WASAPIAudioInputStream::IsMuted() { |
+ DCHECK(opened_) << "Open() has not been called successfully"; |
+ DCHECK(CalledOnValidThread()); |
+ if (!opened_) |
+ return false; |
+ |
+ // Retrieves the current muting state for the audio session. |
+ BOOL is_muted = FALSE; |
+ HRESULT hr = simple_audio_volume_->GetMute(&is_muted); |
+ DLOG_IF(WARNING, FAILED(hr)) << "Failed to get input master volume."; |
+ |
+ return is_muted != FALSE; |
+} |
+ |
// static |
AudioParameters WASAPIAudioInputStream::GetInputStreamParameters( |
const std::string& device_id) { |