Solved

check if headphone/headset is plug or not

Posted on 2006-06-22
5
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

632 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