Yury Schkatula
Yury Schkatula

Reputation: 5369

Windows API to subscribe for VoIP activities like "Sound -> Communications" does?

Situation: at Windows "Control Panel", you can visit "Sound" widget and switch to "Communications" tab. There, you can configure how much %% the OS should reduce all other sounds if we have incoming VoIP call ringing (to not miss the call, indeed).

Question: is there any API that allows a developer to subscribe and react on such events too? (let say, auto-pause your game app, or "do not disturb" auto-status for the call duration in your messenger app, or any other smart thing you can do for better user experience).

Note: I'm looking for OS-wide API, not "SDK for VoIP app X only".

Upvotes: 2

Views: 149

Answers (1)

Samantha
Samantha

Reputation: 975

It turns out that the Microsoft term for this is Custom Ducking Behavior. The seemingly-odd name is explained by the Wikipedia page on ducking:

Ducking is an audio effect commonly used in radio and pop music, especially dance music. In ducking, the level of one audio signal is reduced by the presence of another signal. In radio this can typically be achieved by lowering (ducking) the volume of a secondary audio track when the primary track starts, and lifting the volume again when the primary track is finished. A typical use of this effect in a daily radio production routine is for creating a voice-over: a foreign language original sound is dubbed (and ducked) by a professional speaker reading the translation. Ducking becomes active as soon as the translation starts.

From the MSDN, the APIs you need to implement custom ducking behavior are COM-based. In summary:

  • MMDevice API for multimedia device enumeration and selection.
  • WASAPI for accessing the communications capture and render device, stream management operations, and handling ducking events.
  • WAVE APIs for accessing the communications device and capturing audio input.

Code samples to implement the functionality you want are available at the respective MSDN pages.

Upvotes: 1

Related Questions