title: Cordova record audio on ios9 does not work
body: <p>I am using Cordova to build an html5/JS app.</p>
  
  <p>I have to record and play audio, so i use Media &amp; File plug-ins, but i have problem to make it work on iOS.</p>
  
  <p><strong>My steps :</strong></p>
  
  <p>1)</p>
  
  <p>I detect platform (Android or iOS).</p>
  
  <p>If Android, no need to set anything, it works.</p>
  
  <p>If Ios, I set the file URI to '../Library/NoCloud/' (after reading <a href="https://www.raymondcamden.com/2015/07/27/recording-and-saving-audio-in-cordova-applications/" rel="nofollow">Raymond Camden article</a>),</p>
  
  <p>then I create file before recording :</p>
  
  <pre><code>var mediaBaseUrl = '';
  if(app.isIOS){
              mediaBaseUrl ='../Library/NoCloud/';
              createFileSystem();
  }
  </code></pre>
  
  <p>My createFile function is :</p>
  
  <pre><code>createFileSystem : function(){
          var fileName= mediaBaseUrl+[myFileName];
  
          //asking for a new space
          window.requestFileSystem(
              LocalFileSystem.PERSISTENT, 
              0, 
  
              //success 
              function(fileSystem){
  
                  fileSystem.root.getFile(
  
                      fileName, 
                      { create: true, exclusive: false },
  
                      //success callback
                      function(){
                          console.log('ok file created');
                      }, 
                      null
                  );
              },
  
              // error
              function() {
                  console.log("***log: failed in creating media file in requestFileSystem");
              }
          );
      },
  </code></pre>
  
  <p>2) Once file is created, i create recorded file with Media constructor :</p>
  
  <pre><code>var recordedFile = new Media(
                  mediaBaseUrl + [myFileName], 
  
                  // success callback 
                  function () {},
  
                  // error callback
                  function (err) {
                      console.log("recorded file error " );
                      console.log(err)
                  }
              );
  </code></pre>
  
  <p>3) In config XML, i have this line to record in iOS Library Folder, and no save in Cloud :</p>
  
  <pre><code>  &lt;preference name="iosPersistentFileLocation" value="Library" /&gt;
    &lt;preference name="BackupWebStorage" value="none" /&gt;
  </code></pre>
  
  <p><strong>My problem :</strong></p>
  
  <p>On Android device, all is fine, i can record then listen audio file.</p>
  
  <p>But on iOS device (ipad2), some things are strange :</p>
  
  <ul>
  <li><p>with my filename "../Library/NoCloud/myFileName", i have no success callback for fileSystem.root.getFile function, but i can see a file with the good name and the good place in my ipad Library/NoCloud folder, <strong>except the file is empty.</strong> So the Media constructor can not play the file and return an error.</p></li>
  <li><p>if i set myFileName as "myFileName", i have the callback of file creation ('ok file created'), but the Media constructor cannot access to the file and return the error :</p>
  
  <pre><code>message: "Cannot use audio file from resource 'test.wav'", code: 1
  </code></pre></li>
  </ul>
  
  <p>I have checked ipad microphone, it is activated for this app. I believe it worked before the iOS update on ipad (now iOS 9.3.2), btu i am not sure anymore.
  Is there something that i did wrong, or is there a new way to process ?</p>
  
  <p>thanks !</p>