473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to get media player sound card selection in c#?

hi guys! i having a problem in my project which is create a media player and let the user choose the sound card for audio output. Let say i have 2 sound card in my computer, i want to select the sound card to play an audio file. i'm using C# window media player com component. eg. axWindowsMediaPlayer1. your kindly help much much appreciated. Thanks!
Jul 9 '08 #1
2 4715
Curtis Rutland
3,256 Expert 2GB
Well, I know a way to detect all your sound cards:
Expand|Select|Wrap|Line Numbers
  1. string query = "Select ProductName from Win32_SoundDevice";
  2. ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
  3. foreach (ManagementObject device in searcher.Get())
  4.     Console.WriteLine("Sound card is {0}", device.GetPropertyValue("ProductName"));
  5.  
There's the first step.
PS, google helps. That's where I found this solution.
Jul 9 '08 #2
Curtis Rutland
3,256 Expert 2GB
I've dug up some more information, but I can't really piece it together myself. I think you are going to have to use the winmm.dll. I think that the method you will need to use is waveOutOpen. I know that you can change the query of the last example to give you a DeviceID. But after that, it's a bit beyond me. Hopefully someone else can help piece it together.
Jul 9 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: FE | last post by:
Hi, I need to create a program that will connect a media stream (a server on the internet - Windows Media format) and then generate an error when : * The stream is ok but there is no sound...
0
by: John Granade | last post by:
I'm using Windows Media Player object in a VB.net app but I'm reinventing the wheel to give users the ability to select their media. What I'd like to do is just use the "setTaskPane" switch to...
1
by: Darren Soo via .NET 247 | last post by:
Hi, wondering if anyone can help me out here. I wrote a VB.NETapplication with Windows Media Player embedded into theapplication. The player is suppose to start automatically whenthe application...
0
by: antonyliu2002 | last post by:
I am implementing a web application from which users will listen to some English words and then select what they hear. Basically, it would look something like the following: ...
2
by: benmourra | last post by:
Hi all, I'm trying to create a web page using VS2005, ASP.NET 2.0, that will allow me to choose from a list of media files on my computer and then play my selection within an embedded Windows...
19
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make...
1
by: =?Utf-8?B?bW91bnRpYW5naXJsNDA=?= | last post by:
The trouble that I am having is the volume on my Windows media player 10...it is adujusting on its own. I have contacted the maker of my pc and have set all master volumes to high thinking that...
5
by: Fred Chateau | last post by:
I am currently using an Object element of type "application/x-mplayer2" to create a media player in ASP.NET 3.5, and was wondering if there is a better way to instantiate WMP in a browser. I'm...
27
by: davidson1 | last post by:
Hai friends..... I am using Compaq Laptop..I used to hear songs most of the time...but suddenly when i open the Windows Media Player to hear the songs..it is not singing..but gives me the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.