Solved

check if headphone/headset is plug or not

Posted on 2006-06-22
5
279 Views
Last Modified: 2010-04-05
do someone knows how to check if the microphone/headphone/headset is plugged/attached or unplugged in your pc?
0
Comment
Question by:drake_leon
5 Comments
 
LVL 6

Expert Comment

by:saravananvg
ID: 16966413
Hello Sir,

  You can check the following site if this could help you in any way.

http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_10016360.html?query=detect+microphone&clearTAFilter=true

with regards,
padmaja.

0
 
LVL 4

Expert Comment

by:kenpem
ID: 16967274
I doubt you'll have much luck with detecting what's actually plugged in. This would depend entirely on the manufacturer of the PC/sound card/BIOS, and would be really difficult to get at. Plus it would change on the next PC you come across. BUT if you can (as per saravananvg's suggestion) see that something is being "heard" on the microphone (and the PC doesn't have one built-in!) that's a good hint that a headset might be connected.
0
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 125 total points
ID: 17121136
My solution: pop up a messagebox and ask the user... :-)

I don't think most hardware soundcards have the appropiate functionality for this. Besides, you will have to deal with the possibility that multiple devices might be available on the system. For example, the user might have a regular soundcard and an additional USB device which happens to be a headphone that connects to USB. (Like the SkypePhones.) Maybe they also have a modem in their system which might also appear as an input device for sound. Thus, the best solution is to ask the user if a headphone is connected. And if it is, then ask where.

I know, this solution sucks...
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now