title: Using PhoneGap to record audio to documents folder on iOS
body: <p>As part of an iPhone app I'm creating using PhoneGap, I need to be able to use the microphone to record to a new file which is sorted in the apps document folder on the phone.</p>
  
  <p>I think I have the code sorted to actually capture the recording I'm just having trouble creating a blank .wav in the documents folder to record to.  According to the PhoneGap API iOS requires that the src file for the audio already exists.</p>
  
  <p>Can anyone help my with the couple of lines of code needed to create this blank file?  My code so far is -</p>
  
  <pre><code>function recordAudio() {
      var src = "BLANK WAV IN DOCUMENTS FOLDER";
      var mediaRec = new Media(src, onSuccess, onError);
  
      // Record audio
      mediaRec.startRecord();
  
      // Stop recording after 10 sec
      var recTime = 0;
      var recInterval = setInterval(function() {
          recTime = recTime + 1;
          if (recTime &gt;= 10) {
              clearInterval(recInterval);
              mediaRec.stopRecord();
          }
      }, 1000);
  }
  
  function onSuccess() {
      console.log("recordAudio():Audio Success");
  }
  
  // onError Callback 
  function onError(error) {
      alert('code: '    + error.code    + '\n' + 
            'message: ' + error.message + '\n');
  }
  
  $('#record-button').
  bind('tap', function(){
      recordAudio();
  })
  </code></pre>