AutoHotkey Community

It is currently May 26th, 2012, 1:25 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: May 4th, 2006, 8:27 pm 
I doubt it's possible, but I am wondering if there is a way to detect if headphones are currently plugged into the headphone jack...

It's probably very dependent on the system, but I figured it wouldn't hurt to ask. I work in an elementary school computer lab and sometimes the kids pull the headphones out of the plug and the audio plays really loudly, thus disturbing everything.

If there is a way to detect when this happens, I can have a script mute the sound until the headphones are plugged back in.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 4th, 2006, 8:33 pm 
Offline

Joined: December 22nd, 2005, 7:43 pm
Posts: 245
Perhaps you can just lower the main volume and raise the headphone volume in the volume control window.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 4th, 2006, 11:04 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
Usually there's no seperate slider for headphone volume. I don't think it's possible to know if headphones have been plugged in.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 5th, 2006, 12:10 am 
Greg wrote:
Perhaps you can just lower the main volume and raise the headphone volume in the volume control window.


Even if you could raise the headphone volume manually, lowering the main volume would take precedence over that.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 5th, 2006, 8:31 am 
I thought about to detect a signal at this chanel using a frequency analyzer. The other (brainfart) option would be to connect a microphone and if the headphone is disconnected the mic should indicate that the sound level at this environment has changed. :roll:

Isn't there anything which displays that a headphone is currently dis-/connected ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 5th, 2006, 9:57 am 
Offline

Joined: April 28th, 2006, 12:12 pm
Posts: 55
I use a USB headphone (headset with mic) - It is listed in "Sounds and Audio Devices" as a separate device.

I have shortcut in the startup folder to C:\WINDOWS\SYSTEM32\SNDVOL32.EXE /D1 which opens the volume control for this device which has the title "Speaker" instead of the normal "Volume Control". The switch /D1 causes this separate device's volume control to open.

When the headset is not plugged in, running this shortcut brings up the default "Volume Control".

The point with this is that I can have quicker access to the volume controls for the headset when I am using it with, for example, Skype instead of having to go through the Control Panel to open the volume control.

I use Volume OSD - updated by Rajat (http://www.autohotkey.com/forum/viewtopic.php?t=88)

I would like there to be a similar autohotkey script to control the headset volume controls, but I have no idea how to create it.

Does anybody have any ideas?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2008, 3:35 pm 
Offline

Joined: March 6th, 2007, 4:35 pm
Posts: 64
Location: Columbus, OH, USA
I wondered if we could revisit this topic... has anyone figured out how to detect when regular headphones are plugged in or disconnected?

I recently saw this article over at lifehacker... there's a Mac app that does this: http://lifehacker.com/368768/pause-itunes-whenever-you-unplug-your-headphones-with-breakaway

_________________
My startup is Telesaur - a telecommuting job site.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2008, 4:24 pm 
When I ran a computer classroom there were no external speakers on the machines. Every machine came with them, there were all in a big box somewhere.

FWIW


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2008, 9:31 pm 
I am also looking for a solution to having the volume muted when the earphones come out. I thought to use SoundSet to mute the speaker volume then unmute the headphones volume, but that muted everything:

SoundSet 1, speakers, mute
SoundSet 0, headphones, mute

I must be misunderstanding something about the relationship between the sound components.

In theory tho, windows realizes when you plug your headphones in and mutes the speakers, and unmutes them when you pull them out. We just want to be able to do the opposite...

Any ideas?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2008, 11:12 pm 
Offline

Joined: May 17th, 2007, 9:06 pm
Posts: 421
Location: England
Ursu wrote:
In theory tho, windows realizes when you plug your headphones in and mutes the speakers, and unmutes them when you pull them out. We just want to be able to do the opposite...

Actually I think this is a hardware based solution that soundcard manufacturers use and the OS doesn't have any say in it


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2008, 5:33 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
yes, it is done in hardware. the connector has 5 pins, and when you plug in your headphones, the spring contacts disconnect from the two pins that go to the speakers and are touching the headphones, directing the sound voltage to the headphones. The OS knows nothing about it.

In the case of a USB headphone/microphone, you are technically unplugging the entire soundcard, which the OS does notice.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2008, 7:42 pm 
when i plug in my mp3 headphone into the headphone hole, this happens:

(using Vista, my XP computer doesnt show this message)

Image


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2008, 12:44 pm 
That's right, some soundcards detect when you plug something. Maybe this can be used to mute the whole computer when something is unplugged !?


Report this post
Top
  
Reply with quote  
PostPosted: December 4th, 2008, 1:41 am 
Offline

Joined: October 30th, 2008, 12:03 pm
Posts: 33
MAX wrote:
I doubt it's possible, but I am wondering if there is a way to detect if headphones are currently plugged into the headphone jack...
I don't know how they do it, but my mainboard soundcard driver "Realtek HD Audio Manager" displays exactly that under "Audio - E/A". I guess it is an impedance measurement, so if resistance falls below a special threshold, the software expects a mike or whatever to be plugged in.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cerberus, SifJar, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group