summaryrefslogtreecommitdiffstats
path: root/pica-client/nativeaudio_wasapi.cpp
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-09-13 19:53:28 +0400
committerAnton <anton@picapica.im>2026-09-13 19:53:28 +0400
commit9a84c95af6771590d4e5fe436e77bbe92a9dea92 (patch)
tree71511a89b296d02d4106f9f031de806c8db422b7 /pica-client/nativeaudio_wasapi.cpp
parente62dd7d30bec7a679013dcce8ec4bc2b2f842109 (diff)
downloadpica-pica-9a84c95af6771590d4e5fe436e77bbe92a9dea92.tar.gz
pica-pica-9a84c95af6771590d4e5fe436e77bbe92a9dea92.zip
pica-client: use webrtc-audio-processing instead of speexdsp for echo cancellation
Diffstat (limited to 'pica-client/nativeaudio_wasapi.cpp')
-rw-r--r--pica-client/nativeaudio_wasapi.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/pica-client/nativeaudio_wasapi.cpp b/pica-client/nativeaudio_wasapi.cpp
index 449dcd7..c0f5130 100644
--- a/pica-client/nativeaudio_wasapi.cpp
+++ b/pica-client/nativeaudio_wasapi.cpp
@@ -299,7 +299,11 @@ IMMDevice *WasapiBackend::resolveDevice(const QString &device, bool isCapture,
// A ringtone is not a call and belongs on the console endpoint, so
// that it is heard on the speakers rather than in a headset the user
// is not wearing yet.
- const ERole role = (mode == NativeAudioVoiceCall) ? eCommunications : eConsole;
+ //
+ // Both call modes take the communications endpoint. Cancelling the
+ // echo ourselves is a reason not to ask for the endpoint's voice
+ // processing, not a reason to move the call to a different device.
+ const ERole role = (mode != NativeAudioPlain) ? eCommunications : eConsole;
hr = devEnum->GetDefaultAudioEndpoint(isCapture ? eCapture : eRender, role, &dev);
}
else
@@ -407,6 +411,10 @@ bool WasapiBackend::open(const QString &device, int sampleRate, int channels, bo
// Asking for it on render as well is what made the settings dialog's
// microphone test come out chopped while the ring test, which opens a
// plain stream, was clean.
+ //
+ // NativeAudioVoiceCallRaw is a call that cancels its own echo, so it does
+ // not want the endpoint's processing either - this is the one place where
+ // it differs from NativeAudioVoiceCall.
if (mode == NativeAudioVoiceCall && isCapture)
requestCommunicationsCategory();