change action of headset button I recently buy a samsung galaxy s dous 2.

when i connect my headset and press the button on headset, it play/pause music.
I there any way to change this action?

actually I need a voice recorder app that when I press the headset button it start recording and after hitting it again stop it.

is there any solution for this kind of issue?
There are a bunch of "headset button controllers" out there in the wild, several are even going by that name. A search for "headset control" will give you a list of candidates. Some are generic ones, some are specific to a given headset manufacturer (but still working with others). Don't let yourself be disappointed if the first one you chose doesn't work exactly as you wish, simply try another (I found mine on the third match): it's not that your headset is "incompatible", it's the combination of headset, device, and app to make the perfect match which might need a couple of tries.