title: Using MediaRecorder to write to a buffer or FIFO
body: <p>I am developing a low data rate VoIP kind of project .  I need to capture audio at low data rates and store it in an internal buffer or FIFO (NOT in a file).  </p>
  
  <p>I would like to use low data rate .AMR encoders, which means AudioRecord is out.  MediaRecorder looks like it does exactly what I want except that it seems to write to a file.  </p>
  
  <p>MediaRecorder takes a FileDescriptor... is there any way I can write a class that implements the FileDescriptor interface... acting as a sync for bytes... but instead of sending them to a file they are stored in a buffer?  The documentation on FileDescriptor specifically says that Applications shouldn't write their own but why not and is it possible anyway?</p>
  
  <p><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/io/FileDescriptor.html" rel="nofollow">http://docs.oracle.com/javase/1.4.2/docs/api/java/io/FileDescriptor.html</a></p>
  
  <p>In short, I'd like to develop my own stream, and trick MediaRecorder to send data to it.  Perhaps doing something tricky with opening both ends of a socket within the same APK and giving MediaRecorder the socket to write to?  Using the socket as my FIFO?  I'm somewhat new to this so any help/suggestions greatly appreciated.</p>
  
  <p>I have a related question on the RX side. I'd like to have a buffer/fifo that feeds MediaPlayer.  Can I trick MediaPlayer to accept data from a buffer fed by my own proprietary stream?</p>