iPhone API - Sending electric signals thru audio jack - iphone

Anyone know if this is allowed by the iPhone's various Api's or even if Apple allows this?
Example: Plug something in the audio jack and use it as a "taser" (this is just a hypothetical/proof-of-concept example).

Yes. The standard way of "sending electrical signals through the audio jack" is
known as "playing audio", and I'm pretty sure this is possible on the iPhone.

Related

Data transfer between iphone and BT device

Is it possible to transfer data from/to iphone through headset using some modulation(fsk for example)? From theoretical point of view it looks completely possible.
Yes, you could consider in-code FSK demodulation.
Take a look at O'Reilly's iPhone Hacks - there's a nice chapter on serial modem.
True - it uses Headphone Jack but you'll get the feeling on how to handle audio 'data'.
You can also download the source from iPhone Hacks source code
EDIT: there's also an awesome link collection in not really Jake's answer here:
Using an iPhone audio dongle to transmit data

voice changer, how is made?

I'm looking to implement a voice changer into my iPhone app. Something a bit like Talking Friends. I have 5 different voice styles.
anyone can give a hint
any info much appreciated
thx.
Unfortunately there is no UIDarthVaderify() object. There's an open source project called Skype Voice Changer, it's in C# so you obviously can't use it directly in a Cocoa Touch project but you can learn how voice changing works. Essentially you're looking to change the frequency distribution of the output signal without changing the envelope that represents the phonemes being made by the speaker.

Is it possible to read iPhone or Android display data through the audio jack?

I'm not very well versed in the iPhone and Android API, so please bear with me if this is a stupid question.
As I understand it, Square's card reader works by converting the magnetic information on the card stripe into an audio tone that its software can then process. [1]
In a similar way, is there a way to somehow read what exactly is being displayed on the device screen simply through a small device inserted into the audio jack on that device?
[1] http://www.quora.com/How-does-Squares-hardware-work
It's not quite clear what you wish to achieve. You can indeed make an app that would output a representation (perhaps audio frequency-shift keying?) of the screen's contents to the iPhone's audio jack.
The iPhone (and other iOS-based devices) use TRRS connectors for bi-directional audio (and hence arbitrary modulated data) communication and there are well-supported publicly-documented APIs for using these interfaces.
That said, if you're writing your own app: why would you want to output the contents of the screen? If you are developing the app in question, why not transmit the salient data in a more effective manner? Which leads me to my next assumption:
You want to read what's being displayed on the device's screen at any time, not just when an app of your creation is open. In this case, the answer is that it is not possible, with the possible exception of a jailbroken solution. That said, I can't imagine a jailbroken solution being useful much longer on account of iOS 5 introduced "display mirroring" by means of AirPlay.
On Android, I have no idea. :-)
No. The screen is not connected to the audio jack.
I think you can make an app to take a screenshot and then encode that photo as music to play it.
It won't sound good though :)
For this kind of task, there is built in camera

How Square implemented data transfer to iPhone?

Some days ago I saw a interesting device for iphone, square, here: https://squareup.com/
you can plug it into iphone's earphone socket, and it can transfer data to iphone. A running App on iphone can receive it.
does any one know how it implemented? I guess it can encode data to audio stream and "sing" it, and App on phone can record the sound and decode it. but how to? is there a protocol or SDK?
The implemention is likely to be no different to that of a simple acoustic modem. The relevant APIs include Audio Units (low-level) or Audio Queue Services (higher level).
Matt Gallagher has written an excellent (as always!) post on creating an iOS tone generator, which is one way of enabling what you are after.

Outputting audio to paired bluetooth device?

I ride an off-road motorcycle on the unsurfaced road network of ancient byways in the UK. It's great fun, but I've yet to find a good turn-by-turn application suitable for this purpose. So, I figured I'd write one :)
I have a bluetooth system in my helmet. Is there any way of streaming audio to a paired bluetooth device from an iphone app. I can't see any reference to this in the SDK docs. I don't use the TomTom app, but I guess that must do it?
I think this is what you are looking for. It's very well documented in the Apple Docs.
IOBluetoothDevice
Here's a topic that could be of help too:
Topic
I think it you pair the Bluetooth device, then using it to receive audio shouldn't be hard.
Having said that I modified my answer, because Headphones ( when paired via bluetooth ), should appear as routes in Core Audio ( making it trivial to pass audio to them ). If you want to use anything sophisticated with bluetooth ( more than just passing audio , I think GameKit is your best shot. )
Hope I helped