Bill,
How does the operating system know that an audio cable extension is
plugged in?
Take a look at this image. I think you wil get the idea.
https://www.cui.com/image/getimage/9166
(
https://www.cui.com/blog/understandi...and-schematics )
Regards,
Rudy Wieser
P.s.
It would be a bit more difficult to check if a headphone was plugged into
the /extension cord/ or not. Not that difficult though: it could just put a
small bit of current into the cable (posibly at a frequency below 20 Hz),
and see if it comes back. If not, no headphones.