2

I know that some devices headphone ports (maybe all of them? any reference here would be good) have 3 channels, for stereo sound and microphone. So I was wondering if it's possible to detect something like this pedal on these devices.

If it's possible, using the audio recorder would be enough? I'm studying possibilities for an app here, and this sounds promising if possible.

3
  • 1
    For close voters: While the OP's motivation is for app development, the answer to this question could be of use to general Android users considering certain peripherals.
    – ale
    Commented Nov 27, 2012 at 16:07
  • Well, if this is in the wrong forum I have a totally wrong idea what this is for. I assumed this was better here than in stackoverflow.
    – gameower
    Commented Nov 27, 2012 at 16:35
  • Check the FAQ. Android development questions are off-topic here; they belong on Stack Overflow. However, as I've said, I don't think this question is necessarily off-topic.
    – ale
    Commented Nov 27, 2012 at 17:11

2 Answers 2

2

Sure you can, there's a product that uses the audio port as an extra button, check this:

http://gizmodo.com/add-a-button-to-any-android-phone-with-this-genius-head-1221431712

Maybe this is more like a comment than an answer, but actually i can't add comments untill i reach 50 points.

By the way, as microphone it's an analog input for the android, you can set a trigger point on certain value to detect an (On/Off) state, for example:

If microphone values are in a range from 0 to 1024, you can set that if input it's less than 100 consider it as Pedal Pressed, if it's greater than this, pedal it's not pressed.

You just need to read microphone input and convert it to it's analog values instead of treating it as audio.

1
  • I think you've done exactly the right thing posting this as an answer. Answers are for giving information; comments are for asking for more information.
    – Dan Hulme
    Commented Apr 8, 2014 at 8:21
0

I've never tried but I strongly doubt it, for reasons that are nothing to do with Android itself. Each manufacturer has their own variant of the headset connector on their phones, but they're all compatible with standard stereo headphones. This implies that the tip and the first ring are outputs (the left and right channel), not inputs.

In contrast, digital keyboard pedals like the one you linked to tend to be wired like microphones, with the output (from the pedal's point of view) on one or more of the connections where the phone is expecting its output to be.

For this reason I doubt you'll be able to do something like this on any kind of phone without some custom hardware. That said, you do get USB foot-pedals for typing (you can configure them as an extra shift key or similar), so one of those might satisfy your need.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .