summaryrefslogtreecommitdiffstats
path: root/pica-client/capturegain_wasapi.cpp
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-09-03 21:01:17 +0400
committerAnton <anton@picapica.im>2026-09-03 21:01:17 +0400
commite62dd7d30bec7a679013dcce8ec4bc2b2f842109 (patch)
tree0be99751303e3c0b3306b9d79ca344897996a05d /pica-client/capturegain_wasapi.cpp
parentc6649895d58bcfab864bcc33b131db222e45bfef (diff)
downloadpica-pica-e62dd7d30bec7a679013dcce8ec4bc2b2f842109.tar.gz
pica-pica-e62dd7d30bec7a679013dcce8ec4bc2b2f842109.zip
pica-client: more improvements of echo cancellation
Diffstat (limited to 'pica-client/capturegain_wasapi.cpp')
-rw-r--r--pica-client/capturegain_wasapi.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/pica-client/capturegain_wasapi.cpp b/pica-client/capturegain_wasapi.cpp
index 15dec57..49ea84d 100644
--- a/pica-client/capturegain_wasapi.cpp
+++ b/pica-client/capturegain_wasapi.cpp
@@ -119,6 +119,21 @@ public:
return true;
}
+ // WASAPI keeps a real decibel value alongside the scalar, so this needs no
+ // conversion of our own.
+ bool gainDb(double *out) override
+ {
+ if (!m_vol || !out)
+ return false;
+
+ float db = 0.0f;
+ if (FAILED(m_vol->GetMasterVolumeLevel(&db)))
+ return false;
+
+ *out = db;
+ return true;
+ }
+
bool setGain(double value) override
{
if (!m_vol)