Upload captured audio to Firebase Storage

Hi community, I am trying to upload to Firebase Storage audio captured using MediaCapture, converting the MediaFile to blob, but when I read the file using readAsArrayBuffer or readAsDataUrl the buffer that returns is empty. I tried a lot of ways to do this but I didn’t solve it. Here is the newest code. Thanks!

    this.mediaCapture.captureAudio().then(res => {
      var date = new Date();
        let name = res[0].name;
        let path = res[0].fullPath.substr(0, res[0].fullPath.lastIndexOf('/'));
        this.file.resolveDirectoryUrl(path).then((resolvedPath: DirectoryEntry) => {
          this.file.readAsArrayBuffer(resolvedPath.nativeURL, name).then( (buffer:any) => {
            let blob = new Blob([buffer], {
              type: res[0].type,
            this.angularFireStorage.ref('chats/'+ this.chat + '/users/' + this.user.uid + '/audio/' + date).put(blob);
          }).catch(error => {
      } catch(error){

I solved the problem by adding: android:requestLegacyExternalStorage="true"to AndroidManifest.xml