473,388 Members | 1,408 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,388 software developers and data experts.

Detecting Headphones

Is there anyway to detect whether the user has plugged in his
headphones using C#?
How?
Mar 21 '08 #1
4 4405
"Mugunth" <mu***********@gmail.comwrote in message
news:55**********************************@e10g2000 prf.googlegroups.com...
Is there anyway to detect whether the user has plugged in his
headphones using C#?
How?
Even the soundcard probably doesn't know. I know that laptops mute their
speakers when the headphones are plugged in, but do they do it under CPU
control, or do they just have switch contacts built into the headphone jack
the way radios do?
Mar 21 '08 #2
On Mar 21, 9:34 am, "Michael A. Covington"
<l...@ai.uga.edu.for.addresswrote:
Even the soundcard probably doesn't know. I know that laptops mute their
speakers when the headphones are plugged in, but do they do it under CPU
control, or do they just have switch contacts built into the headphone jack
the way radios do?
FWIW, if I plug headphones into my computer I get a volume control
dialog opening automatically. So some soundcards do in fact know if
something has been plugged in or not. How this is done, I'm not sure,
and I don't even know if it's a feature on all soundcards.

The "card" in question is an intel one integrated onto the motherboard.
Mar 21 '08 #3
Andy wrote:
On Mar 21, 9:34 am, "Michael A. Covington"
<l...@ai.uga.edu.for.addresswrote:
>Even the soundcard probably doesn't know. I know that laptops mute
their speakers when the headphones are plugged in, but do they do it
under CPU control, or do they just have switch contacts built into
the headphone jack the way radios do?

FWIW, if I plug headphones into my computer I get a volume control
dialog opening automatically. So some soundcards do in fact know if
something has been plugged in or not. How this is done, I'm not sure,
and I don't even know if it's a feature on all soundcards.

The "card" in question is an intel one integrated onto the
motherboard.
You could look at new Microsoft.DirectX.DirectSound.Device().SpeakerConf ig
and see if the driver changes it.
Mar 21 '08 #4
On Fri, 21 Mar 2008 06:34:09 -0700, Michael A. Covington
<lo**@ai.uga.edu.for.addresswrote:
"Mugunth" <mu***********@gmail.comwrote in message
news:55**********************************@e10g2000 prf.googlegroups.com...
>Is there anyway to detect whether the user has plugged in his
headphones using C#?
How?

Even the soundcard probably doesn't know. I know that laptops mute their
speakers when the headphones are plugged in, but do they do it under CPU
control, or do they just have switch contacts built into the headphone
jack
the way radios do?
Actually, the "newer" sound hardware specification does in fact include
support for detection of connection changes. I don't recall the name of
the specification off the top of my head, but I know it's pretty much
standard now and has been for at least a few years, probably longer.

Now, whether Windows provides an API to get at the information, never mind
whether this is exposed in .NET, I have no idea. But the hardware's been
supporting it, and specialized drivers have been taking advantage of it,
for some time.

Pete
Mar 21 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jole | last post by:
Hi I'm writing a program that needs to read from a file. In order for the program to be robust, it should somehow check that the file isn't corrupt, or stuffed in any way. For example, that...
15
by: Jay | last post by:
I'm sure this is a really dumb question, but how do you detect a variable type in Python? For example, I want to know if the variable "a" is a list of strings or a single string. How do I do...
12
by: rawrite | last post by:
I am just finishing watching a documentary about Rod Serling. It was cool, but after 20 minutes it got boring and all I wanted to do is subscribe to Net Flix and rent the Twilight Zone episodes....
3
by: raptor | last post by:
hi, how to detect opera..it seems that even opera8 doesnt support xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera seems to mimic IE, at least in the preferences ?! I havent...
9
by: D. Shane Fowlkes | last post by:
I'm using SQL Server 2000 and on my page, I'm simply creating a SQLDataReader and filling in Labels with the retrieved (single) record. However, how can I prevent from getting errors when a field...
1
by: Deadly_M | last post by:
Here is my problem Have 7,1 Audigy 2 and creative speakers system with CMSS 3D set for maximum effect on the 7.1 speakers But I also Play online games with teamspeak and kids sleeping etc - so...
3
by: regtrashcan | last post by:
I have a webpage that detects whether Shockwave Player is installed and the version number. The javascript/vbscript that I use has worked fine until the latest release of the Shockwave Player. I am...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
5
by: Z.K. | last post by:
In C#, using the StreamReader, how do I detect when you get to the end of line. I am reading a text file using the Read() function and I need to detect the \n\r, but everything I try does not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.