title: Encode MP3 file to base64 string in Ionic
body: <p>I'm working on a app that use cordova-plugin-media to record and audio file, and now I want to encode this file to base64 string, for now I can locate the file but when I try to encode it I get this :</p>
  
  <p>"{"$$state":{"status":0}}"</p>
  
  <p>Here is my code</p>
  
  <pre><code>audio.stopRecord();
  audio.play();
  if(device.platform == "iOS")
  {
      var path = cordova.file.tempDirectory;
  }
  else if(device.platform == "Android")
  {
      var path = cordova.file.externalRootDirectory;
  }
  
  var filename = name + extension;
  var filepath = path + filename;
  
  
  console.log(filepath);
  console.log(JSON.stringify($cordovaFile.readAsDataURL(path, filename)));
  </code></pre>
  
  <p>file path : <code>file:///storage/emulated/0/tPUhcxUKhmLUrWK3Qkqhc69OxeEIWyYrhEB0he9OwM0ffmjY2OUh3TLbFTsApdpIpjxyuC2wouyCs6m7uvdOCHCMiw9mbLMGYM25.mp3</code></p>
  
  <p>Can any one help me with this??</p>
  
  <p>Thanks</p>