Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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.

share|improve this question
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. –  Al E. Nov 27 '12 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 Nov 27 '12 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. –  Al E. Nov 27 '12 at 17:11

2 Answers 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.

share|improve this answer
    
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 Apr 8 at 8:21

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.