My application currently uses the AXWindowsMediaPlayer
component to play videos and in turn sound is played using the default sound device.
I need to add support for playing multiple videos and in turn I need to be able to setup audio sources for each of the videos.
Thoughts on how to achieve this:
AXWindowsMediaPlayer
to my specified device (I Know I can do this in windows media player program but don't know how in code).Can anyone provide some recommendations on how best to achieve what I need and perhaps a link to some documentation I need to be looking at? I can't seem to find anything on this.
I ended up using NAUDIO for this.
This is the code I used:
var waveReader = new MediaFoundationReader(playListItem.FilePath);
_waveOut = new WaveOut {DeviceNumber = playListItem.PlayerScreen.AudioDevice.Id};
_waveOut.Init(waveReader);
wmPlayer.settings.volume = 0;
wmPlayer.URL = playListItem.FilePath;
_waveOut.Play();