5

I am trying to develop a system audio recording application which uses the application loopback method provided by WASAPI. I'm basing my implementation upon the Windows classic samples application loopback example:

https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/ApplicationLoopback

My goal is to use process loopback (via AUDIOCLIENT_ACTIVATION_TYPE_PROCESS_LOOPBACK) so that I can capture the system mix through the Windows audio engine, without installing drivers or doing any injection/hooking.

In my main use case I want to record audio from all applications except my own app, so I’m using PROCESS_LOOPBACK_MODE_EXCLUDE_TARGET_PROCESS_TREE. I have also tested with PROCESS_LOOPBACK_MODE_INCLUDE_TARGET_PROCESS_TREE just to rule that out.

What Works

Using the ApplicationLoopback approach with VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK, my capture app successfully records audio for:

  • Slack

  • Zoom

  • Google Meet in Chrome/Edge

  • Microsoft Teams meetings in a browser (Edge/Chrome)

  • Youtube videos in the browser

On all of these, the output WAV contains valid audio as expected.

What Fails

The problem is only with the Microsoft Teams desktop application (ms-teams.exe):

  • With process loopback (ApplicationLoopback-style):

    • The recording has the correct duration and format.

    • But the audio buffer is effectively all zeros (silence) whenever the audio source is a Teams desktop meeting.

What's strange is that I can record using the older device loopback method (I'll sometimes refer to this as endpoint loopback) https://learn.microsoft.com/en-us/windows/win32/coreaudio/capturing-a-stream

Multiple Streams of MS Teams

To investigate further, I wrote a small diagnostic tool that enumerates audio sessions for a given process using IAudioSessionManager2 and reads the peak levels via IAudioMeterInformation.

For the output device used by Teams during a meeting, I see the following:

  • Two render sessions for ms-teams.exe on the same render device, plus one capture session.

  • Both render sessions:

    • Have the same process ID (ms-teams.exe).

    • Show non-zero peak and average levels while meeting audio is playing.

    • Often have identical or very similar metering values.

For example (simplified sample output):

Session [0]:
  Session GUID:     {0.0.0.00000000}.{6474f13d-839f-4be8-b36c-f653233effdd}|\Dev...
  Grouping GUID:    {C82CDF72-3957-4B52-ABF2-9ACA5F8153A1}
  Samples w/ Audio: 32 / 50 (64%)
  Max Peak Level:   49.6552%
  Avg Peak Level:   12.5515%
  *** THIS SESSION HAS SIGNIFICANT AUDIO ACTIVITY ***

Session [1]:
  Session GUID:     {0.0.0.00000000}.{6474f13d-839f-4be8-b36c-f653233effdd}|\Dev...
  Grouping GUID:    {C82CDF72-3957-4B52-ABF2-9ACA5F8153A1}
  Samples w/ Audio: 32 / 50 (64%)
  Max Peak Level:   49.6552%
  Avg Peak Level:   12.642%
  *** THIS SESSION HAS SIGNIFICANT AUDIO ACTIVITY ***

I also wrote a session enumerator which lists all audio sessions opened for a device and it also shows the same thing:

=== Render Devices ===
Speakers (Realtek(R) Audio) [48000 Hz, 32-bit, 2 ch (Float)] : 0 active sessions
  ID: {0.0.0.00000000}.{357dc357-13e3-4cdb-90c9-ab54f23dedcf}
XG27ACS (Intel(R) Display Audio) [48000 Hz, 32-bit, 2 ch (Float)] : 0 active sessions
  ID: {0.0.0.00000000}.{4af2ff2a-e7bf-4a47-8de4-876e9ba2d6ce}
Speakers (Razer BlackShark V2 HS 2.4) [48000 Hz, 32-bit, 2 ch (Float)] [Default: Console, Multimedia, Communications] : 2 active sessions
  ID: {0.0.0.00000000}.{6474f13d-839f-4be8-b36c-f653233effdd}
  - ms-teams.exe PID: 10596
  - ms-teams.exe PID: 10596
CABLE Input (VB-Audio Virtual Cable) [48000 Hz, 32-bit, 2 ch (Float)] : 0 active sessions
  ID: {0.0.0.00000000}.{65fbe74c-81c9-4c39-8a75-55033aa39f4c}
CABLE In 16ch (VB-Audio Virtual Cable) [48000 Hz, 32-bit, 2 ch (Float)] : 0 active sessions
  ID: {0.0.0.00000000}.{a2a0ed57-95c3-4689-b0ff-efabb8c3efe1}

For all other apps like Slack, Zoom, Chrome, etc., I only see one render session per process on the same device in this scenario.

So Windows thinks Teams is actively rendering audio (meters are moving on both sessions), and endpoint loopback hears it — but the process loopback stream targeting the Teams PID is still all zeros.

I am not aware of any API that lets me choose a specific render session/stream for process loopback; as far as I know, AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS only lets me specify a PID and include/exclude mode.

What I’ve checked

  • Multiple machines (different manufacturers, different audio hardware): same behavior.

  • Different Teams versions, including at least 25306.804.4102.7193 (and earlier builds): same behavior.

  • Verified that:

    • Teams is definitely playing audio through the default output device.

    • Endpoint loopback “hears” it.

    • Other apps are captured fine via process loopback on the same machines.

I’m aware of other people seeing similar symptoms (e.g. ActivateAudioInterfaceAsync process loopback not capturing Teams while capturing other apps, and OBS / win-capture-audio not capturing the new Teams client via per-app capture while device capture still works), but I have not seen any solution reported anywhere.

What I want to know

  • Is there any supported way to ensure that audio from the Teams desktop app is included in the process-loopback stream, the same way it is for other apps and for Teams-in-browser?

  • Or is Teams desktop using a special audio path that is not exposed via process loopback (and if so, is this documented anywhere)?

I’m not looking for solutions involving virtual audio drivers or injecting into Teams; I’m specifically asking about what is possible with WASAPI process loopback, using the same model as Microsoft’s ApplicationLoopback sample.

New contributor
fahdIm is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • The conspiracy theorist in me wonders if this is deliberate on Microsoft's part. Commented 5 hours ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.