For my app, I need to record audio from MIC on an Android phone, and send it over TCP to the other android phone, where it needs to be played.
I am using AudioReco
I got this working, with some help, and only partially.
I started off with the code at http://emeadev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html, changed File's streams to Socket's streams, and changed the isAvailable() to if(inputStream.read(byteArray) != -1).
Live streaming of audio over TCP is happening now.
However,
All I hear at the other end is noise, and I am now hunting for correct set of parameters for AudioRecorder and AudioTrack - the frequency, channel config and encoding, audio source etc.
If you have any idea about this, please let me know.
Thanks,
EDIT: It was a stupid error on my part. In addition to all I have said above, use inputStream on player side and outputStream on recorder side, and byte arrays instead of shorts and it will work. :)