using MediaRecorder or AudioTrack?? an easy way with MediaRecorder is like so...
MediaRecorder mMediaRecorder = new MediaRecorder(); ... FileDescriptor fd = ParcelFileDescriptor.fromSocket(mAudioOutSocket).getFileDescriptor(); mMediaRecorder.setOutputFile(fd); OR For AudioTrack, you should use a background thread to read the data into a buffer and then send the bytes to your server. Make sure you set a high priority for that thread: android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO); In my case, the best (fastest) solution was to use the ndk and read from AudioTrack in a native thread, and send the data using C sockets. -nick- On Aug 13, 12:45 am, cindy <[email protected]> wrote: > My application needs to send data to server while recording the audio > data? > > Does anyone know how to do that? > > Thanks! > > April -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

