简体   繁体   English

如何使用VLC.Net更改音频输出设备

[英]How to change audio output device using VLC.Net

I am able to create media player like app using VLC.Net library. 我能够创建媒体播放器如使用VLC.Net库的应用程序。 I am now trying to add a feature to be able to select the output device to play the media through. 我现在想添加一个功能,可以选择输出设备通过播放媒体。 So far no luck. 到目前为止没有运气。 Has anyone ever done it? 有没有人做过呢?

From reading the source code I would try the following. 通过阅读源代码,我将尝试以下操作。 I assume you have a VlcMediaPlayer at hand and created somewhere: 我假设您手边有一个VlcMediaPlayer并在某处创建:

void DoAudio(VlcMediaPlayer player)
{
    IAudioManagement audioMgt = player.Audio;

    foreach(AudioOutputDescriptions descriptions in audioMgt.Outputs.All){

        foreach(AudioOutputDevice device in description.Devices){
            //enumerate them for display
            string audioName = device.LongName;

            // Or set it as output
            device.SetAsCurrent();
        }
}

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

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