McDee
McDee

Reputation: 142

How to change audio output device using VLC.Net

I am able to create media player like app using VLC.Net library. 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?

Upvotes: 0

Views: 1276

Answers (1)

Uwe Hafner
Uwe Hafner

Reputation: 4999

From reading the source code I would try the following. I assume you have a VlcMediaPlayer at hand and created somewhere:

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();
        }
}

Upvotes: 1

Related Questions