title: How to get rec script of SOX to work on Android?
body: <p>I built sox for <code>Android</code> and I am using the generated binary files i.e. <code>sox, rec, play and soxi</code> generated directly in my app  by installing them as binaries within my app.</p>
  
  <p>I am able to invoke commands using <code>sox</code> directly however I have a problem in invoking <code>rec</code> command.</p>
  
  <p>I used the following command, <code>rec -r 8000 -c 2 output.wav</code>
  But it fails saying that <code>sox is not found</code> or <code>sox is expected but is not found</code>.</p>
  
  <p>The above rec command works perfectly in Ubuntu when I use it in command line</p>
  
  <p>Please note that I am able to use operation related to <code>sox</code> binary successfully, but I am unable to use commands related to <code>rec</code> binary.</p>
  
  <p>Initially I thought the problem may be because of permissions imposed by Android so I included these permissions in <code>manifest.xml</code> but to no avail.</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="android.permission.RECORD_AUDIO"/&gt;
  </code></pre>
  
  <p>I did some research and got this <a href="http://billposer.org/Linguistics/Computation/SoxTutorial.html" rel="nofollow">link</a>, it says in section <strong>Using Sox to Play and Record</strong> that there might be some Linux systems which do not accept <code>rec</code> command directly.</p>
  
  <p>I followed his suggestion and appended my commands with <code>padsp</code> etc, but it still doesn't work.</p>
  
  <p>So my question is how do I invoke rec command successfully on Android system, has anyone tried this before?</p>