Solved

check if headphone/headset is plug or not

Posted on 2006-06-22
5
283 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

12 Experts available now in Live!

Get 1:1 Help Now