iosiphoneaudioheadphones

API's for plugging in non-audio related hardware?


Sorry if this a meaningless question or if it is repeated, but just of curiosity, I was searching for some API on iPhone development on plugging in non-audio related hardware, ex: Card reader or whatever through the 3.5mm headphone jack. I was searching through the iPhone development site and came across AUDIOSESSION, so I was wondering if this API can be used for non-audio related hardware or is it strictly for audio like headphones or speakers?

If anyone has an idea or could direct me to some resources, that would be greatly appreciated.


Solution

  • There are no specific frameworks in the SDK, you will have to built it up yourself. You will have to record the audio with Audio Session framework and make some post-processing of the recorded audio. Fast Fourier Transformation (FFT) or Frequency Shift Keying (FSK) is used most frequently. For this there are some support in iOS, check out Accelerator Framework. Then you still have to filter and analyze your data based on how your sensor encodes it. Check out the links in the comments above.