Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change destination speakers of Windows Media Player

Tags:

c#

We're using an embedded AxWMPLib.AxWindowsMediaPlayer to play various audio files in our application (C# code). I'd like to change, programmatically, the destination speakers (output audio device). I can't find any code to accomplish this. I've searched high and low. Nothing tells me how to select and/or change the speakers for audio output. Yet the standard Windows Media Player in Windows XP certainly can change audio devices quite readily via Tools / Options.

(I don't want to change the default sound card, only to change it for the this instance of WMP)

Can someone show me the light on how to change speakers, in C# code?

like image 309
user758795 Avatar asked Nov 04 '22 21:11

user758795


1 Answers

As far as I am aware, the WMP control does not have this capability. You may want to consider using some third-party Media libraries, depending on the type of media you want to use. If you only need to play audio files, you can try the Bass libraries - www.un4seen.com. If you need video capability as well, you may have to use DirectShow. There is a library with samples available here. If you want to use WPF as your view engine, there is a great media library called WPF Media Kit, which is available on CodePlex here.

like image 115
xarizmat Avatar answered Nov 13 '22 03:11

xarizmat