Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Detecting Headphones

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mugunth - 21 Mar 2008 07:11 GMT
Is there anyway to detect whether the user has plugged in his
headphones using C#?
How?
Michael A. Covington - 21 Mar 2008 14:34 GMT
> 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?
Andy - 21 Mar 2008 14:58 GMT
On Mar 21, 9:34 am, "Michael A. Covington"
<l...@ai.uga.edu.for.address> wrote:
> 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.
ignacio machin - 21 Mar 2008 15:50 GMT
> On Mar 21, 9:34 am, "Michael A. Covington"
>
[quoted text clipped - 10 lines]
>
> The "card" in question is an intel one integrated onto the motherboard.

Hi,

I bet it's something implemented on that particular soundcard. Do a
search by that card in Intel website
Ben Voigt [C++ MVP] - 21 Mar 2008 17:18 GMT
> On Mar 21, 9:34 am, "Michael A. Covington"
> <l...@ai.uga.edu.for.address> wrote:
[quoted text clipped - 10 lines]
> The "card" in question is an intel one integrated onto the
> motherboard.

You could look at new Microsoft.DirectX.DirectSound.Device().SpeakerConfig
and see if the driver changes it.
Peter Duniho - 21 Mar 2008 17:57 GMT
>> Is there anyway to detect whether the user has plugged in his
>> headphones using C#?
[quoted text clipped - 5 lines]
> 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.