[Question][Windows] Mic Volume Control for each app

116 views
Skip to first unread message

Wonjin Kim

unread,
Jul 11, 2022, 4:04:55 AM7/11/22
to discuss-webrtc
Hi,
I hope to get some help here.

I used and tested webrtc audio module (a.k.a audio_device_impl ~ audio_device_core_win).
What I tested is changing volume using SetMicrophoneVolume(uint32_t).
But the volume of system mic. was changed. 
(system settings: Settings->Sound->Input->Device Properties->Volume)

I want to change the volume for only process, not system settings.
TESTED: If I set to 50 (0.min ~ 255.max) system settings was set by 20.. (before 100).
WANTED: If I set to 50, system settings' volume is not  changed, only mic volume(gain?) on my app will be changed.

1. Why the changing mic volume affects system settings?
2. How to set mic volume on my app only, not system settings?

Henrik Andreasson

unread,
Jul 11, 2022, 4:49:38 AM7/11/22
to discuss...@googlegroups.com
The API is designed to affect the level of the microphone and it works on a system level. 
If you need something else you can inject your own ADM after making some changes that you need.
To my knowledge, process/app based mic-levels are not supported on all platforms.
In any case, we have no plans to change the existing API.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/26591b60-b438-4453-90d3-6ddb398b2844n%40googlegroups.com.

stron...@gmail.com

unread,
Jul 14, 2022, 10:32:07 PM7/14/22
to discuss-webrtc
Windows do support altering an app's volume solely, by the API called: ISimpleAudioVolume


Anyway, you need to write your own code to implememnt this.

Michael Williams

unread,
Jul 14, 2022, 10:57:53 PM7/14/22
to discuss...@googlegroups.com
WebRTC has to live within the realm of an application unless we add it as a system protocol within each OS.

Also, the management of hardware devices attached to a system has always been subject to the security model for each OS.
In particular, audio input (via mic) is particularly sensitive to security constraints.

Note that audio output is much less risky, and as a result less subject to constraints. 
So, Windows has enabled applications and drivers to share the audio output pathway.
The problem with Windows is that with each major release there is a huge change to audio and video device and tracks security.

This is a holdover from time sharing... that mobile devices are not time sharing with multiple users. As a result, the security model
should be different. But it is not evolved properly.

I Hope this context helps.



--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Henrik Andreasson

unread,
Jul 15, 2022, 7:57:59 AM7/15/22
to discuss...@googlegroups.com
It has been mentioned several times in this forum but the ADMs are old and have not been updated in a long time since they are not part of the WebRTC web standard but mainly serve as experimental native sources and sinks for audio. The API is very granular but it is impossible to fit everyone's needs. That's why we have ensured that external ADMs can be injected and used instead of the default version. It is possible to use the default version as base, make some minor changes locally (e.g. use the ISimpleAudioVolume instead of IAudioEndpointVolume for SetMicrophoneVolume), and inject the modified version instead into the PeerConnectionFactory.

Reply all
Reply to author
Forward
0 new messages