Windows – Set audio endpoint devices application specific (programmatically)

audioaudio-streamingcwindows 10

Edit (17/01/19):

For further details please check this Stack Overflow question [Set audio endpoint devices application specific (programmatically)].

If you find a solution, feel free to post it on both questions.



An audio endpoint device, from here on referred to as 'endpoint', is a physical or virtual audio output or input device.


With the Windows 10 April Update 1803 the long overdue 'App volume and device preferences' have been introduced. These settings allow more control over audio stream management as it is now possible to set different endpoints for different applications, no matter whether that particular application comes with an endpoint selection or not.

However, there is an issue where the audio of a program, whose endpoint is non-default, is streamed through the default endpoint (or not at all) after it has been closed and launched again, although the endpoint is displayed correctly in the settings:

Issue Recreation


What I'm searching for…

… is a programmatically solution to switch between endpoints, which ideally can be launched in form of a script to set the correct endpoint with an application launch.


Edit (15/09/18):

  • Added images

PowerShell does not come with a built-in feature and the registry key HKEY_USERS\S-1-5-21-2064618842-1997473863-574901355-1001\Software\Microsoft\Multimedia\Audio\DefaultEndpoint holds information regarding customised endpoints (Note: the SID S-1-5-2...55-1001 will differ on your system).

I also noticed that it differs from application to application. 'Call of Duty 4: Modern Warfare', 'Call of Duty: Modern Warfare 2' and 'Call of Duty: Modern Warfare 3' will have no sound whatsoever and 'Tom Clancy's Rainbow Six Siege' will always playback sound, but only during the loading sequence will the sound be streamed correctly.

Edit (19/09/18):

Using the 3rd party software 'CheVolume' now, l̶o̶o̶k̶s̶ ̶p̶r̶o̶m̶i̶s̶i̶n̶g̶ ̶s̶o̶ ̶f̶a̶r̶, would still be intrested in a programmatically solution, tho.

Edit (25/09/18):

Still not sure what to think of 'CheVolume', tends to crash a lot and does not work the way it should. Cannot recommend s̶o̶ ̶f̶a̶r̶.

Edit (20/01/19):

Improved formatting (aka copying from the Stack Overflow question). I didn't want to make this an entire copy as the Stack Overflow question was based on this one, so only the important bits have been copied.

Best Answer

While PowerShell itself does not have any direct implementation for this, you could still use PowerShell with some inline C# to make calls to the Core Audio API. There are several examples of such code over StackOverflow:

None of these examples, however, refer to the parts of API that regulate the output of the application, but I think Microsoft must have expanded the API accordingly in 1803 and it should be relatively easy to find. Be sure to check it first, though, before committing yourself to working with code :)

Related Question