14

I'm currently dealing with a new project and I have to send data through headphone jack with specific voltage, then i can work on that voltage.

so here i need to program the specific voltage depends on my data. is it possible that i can access the output voltage of headphones in android and then create a application to control that voltage?

user877329
  • 6,717
  • 8
  • 46
  • 88
Payam Mohajeri
  • 165
  • 1
  • 1
  • 10
  • 1
    for example imagine, instead of listening to a music you see a unique light dancing for that music, then you have a coordination between them. – Payam Mohajeri Apr 20 '12 at 15:20
  • Still not sure exactly what you are asking, if you want to modify the sound going the jack for instance to change volume etc that's one thing. Modifying a voltage would be at the kernel level and require you to build your own for a specific hardware device, and to deploy it you would have to be rooted. – Idistic Apr 20 '12 at 15:23
  • 4
    This is completely possible. This is how https://squareup.com/ is getting data from their credit card reader. – davehale23 Apr 20 '12 at 15:26
  • @davehale23 ok I'll bite, without having dedicated hardware, and without a kernel mod/root how do you propose to send (not read) voltage to a device connected to the port when it's being used as a generic audio headset to modify the output? It seems more likely that what the engineer wants is some way to synch the camera inputs via a histogram or something to the audio outputs (volumen level?) – Idistic Apr 20 '12 at 17:11
  • I recently bought an internet camera security system [Canary](https://canary.is/) which does exactly this. You type in various configuration information into their app on your Android phone, and they transmit this data to the Canary device using a supplied audio cable from the headphone jack. – dodgy_coder Aug 09 '16 at 07:42

4 Answers4

8

Here is a HackADay article dealing with this issue. http://hackaday.com/2010/02/01/android-audio-serial-connection/ It offers working code which was quite a bit simpler than I thought it would be.

Although, like others have suggested, including this very similar SO post, you might have an easier time using the USB port.

Community
  • 1
  • 1
davehale23
  • 4,374
  • 2
  • 27
  • 40
4

the simplest way to catch input data from audio jack in android or iphone is through recording http://developer.android.com/reference/android/media/AudioRecord.html

think something similar like playing a linear pcm audio file , I have n't tried but I believe it should work

Rizwan
  • 118
  • 1
  • 6
  • yes , just remember one thing ,A PCM stream is a digital representation of an analog signal so this can be your key starting point . – Rizwan Apr 24 '12 at 11:19
0

I believe you will have to dive deep into Assembly type language, however, why the headphone jack? As I understand it, only reverberations and sound are transmittable through the headphone jack. I believe it would be more feasiable to output voltage through the Mini-USB port.

I think this site may be of some help regarding my method:

http://pinouts.ru/Slots/USB_pinout.shtml

Chad
  • 872
  • 8
  • 24
0

you could maybe try turning your data into binary for example when your listening to music your head phone jack changes +- vibrating to make a sound so you could make +- = 0 and -+ = 1