ヘッドフォン検出

iOSでヘッドフォンの検出は下記のソースで行えるようだ。

https://github.com/hondasports/HeadphoneDetector

また、ソースの中にあるAudioSessionGetPropertyは下記の返り値が約束されているようだ。

http://ja.softuses.com/28039

AudioSessionGetProperty (kAudioSessionProperty_AudioRoute,
                                              &routeSize,
                                              &route);

    //NSLog(@"Error >>>>>>>>>> :%@", error);
    /* Known values of route:
     * "Headset"
     * "Headphone"
     * "Speaker"
     * "SpeakerAndMicrophone"
     * "HeadphonesAndMicrophone"
     * "HeadsetInOut"
     * "ReceiverAndMicrophone"
     * "Lineout"
     */