简体   繁体   English

有没有办法将应用程序音频更改为不同的音频设备?

[英]Is there a way to change application audio to a different audio device?

I want to be able to change Audio Output/Input device per each application just like in Windows Settings Volume Mixer where you can click on a application and you can change Output device and Input Device .我希望能够更改每个应用程序的音频输出/输入设备,就像在 Windows 设置音量混合器中一样,您可以单击应用程序并更改Output deviceInput Device

I've tried using a Registry Editor and figured out It was in Registry location of Computer\HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Audio\DefaultEndpoint and each folder is 8bit + _0 (idk why) inside of each folder have default key.我试过使用注册表编辑器并发现它位于Computer\HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Audio\DefaultEndpoint的注册表位置,每个文件夹都是 8bit + _0(idk 为什么)在每个文件夹内都有default键。 and I figured out if you change audio output/input device at the same dir you should see new 000_000 , 000_000_p , 001_000 , and 001_000_p and when you delete this key and restart you audio service It will change it to default .我发现如果您在同一目录更改音频输出/输入设备,您应该会看到新的000_000000_000_p001_000001_000_p ,当您删除此键并重新启动音频服务时,它会将其更改为default

My question is there a way to change it?我的问题是有没有办法改变它? I couldn't find Windows api doc for it.我找不到它的 Windows api 文档。 but I did see some other application is able to do it such as https://github.com/File-New-Project/EarTrumpet and https://github.com/audiorouterdev/audio-router但我确实看到其他一些应用程序能够做到这一点,例如https://github.com/File-New-Project/EarTrumpethttps://github.com/audiorouterdev/audio-router

I do believe that those other keys are storing output/input device我确实相信那些其他键正在存储输出/输入设备在此处输入图像描述

Also I found this too https://github.com/Belphemur/SoundSwitch/blob/dev/SoundSwitch.Audio.Manager/AudioSwitcher.cs#L109我也发现了这个https://github.com/Belphemur/SoundSwitch/blob/dev/SoundSwitch.Audio.Manager/AudioSwitcher.cs#L109

The sources you attached show Windows.Media.Internal.AudioPolicyConfig 's SetPersistedDefaultAudioEndpoint function Or IPolicyConfigVista Interface 's globally SetDefaultEndpoint .您附加的源显示Windows.Media.Internal.AudioPolicyConfigSetPersistedDefaultAudioEndpoint函数或IPolicyConfigVista接口的全局SetDefaultEndpoint And It seems audio-router changes the destination process through swapping virtual table between the two Interface objects.并且似乎音频路由器通过在两个接口对象之间交换虚拟表来改变目标进程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM