Set audio endpoint devices application specific (programmatically)

6,548

Solution 1

There are alternatives to CheVolume, some free and some commercial:

EarTrumpet

Downloaded for free from the Microsoft Store or from GitHub. It has a better interface than Microsoft's App volume and device preferences.

See the article EarTrumpet review: A better alternative to the volume control app in Windows 10.

The sources for EarTrumpet are available on github, and I see that reported issues are being answered. You might try to get in touch with the developer, but also the github version might be more recent than the one on Microsoft Store.

Audio Router

Free and open-source product that describes itself as "a similar app that does exactly what CheVolume does, except this is free at least for now". The product is only at version 0.10.2, meaning beta version, and hasn't been updated since 2016. It is further described in the article Audio Router routes audio from programs to different audio devices

enter image description here

VB-CABLE Virtual Audio Device

Donationware product described as :

VB-CABLE is a virtual audio device working as virtual audio cable. All signals coming in the CABLE input is going to the CABLE output. Then It becomes simple to make computer audio recording or to connect a player application to a recorder one.

The one cable is offered for free, and donating will gain you two more cables.

enter image description here

VB-Audio VoiceMeeter

Offered by the same company, this other donationware product does mixing. It allows managing two Hardware Inputs (Microphone A and B for example) and one Virtual (your desktop sound or game sound), as well as two Hardware Outputs (two Headsets, or your Headsets and Speakers) and one Virtual (for example your recording software). All these devices can be managed in one interface.

enter image description here

VB-Audio Voicemeeter Banana

Still offered by the same company, Voicemeeter Banana adds one Hardware and one Virtual device for each In and Output voice.

enter image description here

Virtual Audio Cable

Commercial product ($35) that can connect everything with anything, and is counted as the best of its kind.

enter image description here

Solution 2

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 :)

Share:
6,548

Related videos on Youtube

FatalBulletHit
Author by

FatalBulletHit

Updated on September 18, 2022

Comments

  • FatalBulletHit
    FatalBulletHit over 1 year

    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.

    • harrymc
      harrymc over 5 years
      A problem of terms : Could you explain what you mean by "setting output"? Better add to your answer the exact manipulations that you do in Windows.
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 5 years
      I have ideas too but I'd need to see some visuals of these screens and the way you select the options and such for changing to and then back to or whatever. Not certain I'll have time for an answer but maybe an idea or similar answer link.
    • FatalBulletHit
      FatalBulletHit over 5 years
      @harrymc @PimpJuiceIT Added some additional information, also thanks to @MichałSacharewicz. I also had a look at Stream Management and Audio Endpoint Devices, but that's way above my head right now.
  • FatalBulletHit
    FatalBulletHit over 5 years
    First of all thanks for your answer. However, I barely understand anything looking through the API, any advice?
  • DavidPostill
    DavidPostill over 5 years
    Comments are not for extended discussion; this conversation has been moved to chat.
  • Jerome
    Jerome over 2 years
    EarTrumpet actually re-applies the setting if you close and re-open the app... needs upvoted to the moon 🚀. I tried Audio Router, Windows 10's, etc., they worked, but not after relaunching.