There are many articles on how to detect if a microphone is connected to an iPod touch G2 via AudioSessionGetProperty / kAudioSessionProperty_AudioInputAvailable, but I have not seen any articles related to detection of headphones connected to an iPod touch G1.
To review: iPod touch G2 hardware differs from iPod touch G1 hardware in the following ways:
- iPod touch G2 has an internal speaker
- iPod touch G2 is able to use microphone off of headphone port
I have an app that needs to play sound to be useful and I want to be nice and have a detector that shows that the app is useful once they connect up some headphones.
My initial trials show that the AudioSession APIs (and specifically the AudioSessionGetProperty with the kAudioSessionProperty_AudioRoute constant) always reports back 'Headphone' even if headphones are not connected to an iPod touch G1.
Am I missing something? Do I have something cross wired with my AudioSession calls? If anyone has tried this on an iPod touch G1 and got a different result? Is there another way to weave through AudioSession APIs and get what I am after?
This is all against iPhone OS 3.0 and the iPhone OS 3.0 SDK on real iPod touch G1 hardware.
Thanks in advance, --Batgar